May 2017
Beginner to intermediate
328 pages
7h 17m
English
The data used as an example is extracted from the Czech hydrological dataset. Its location was mentioned at the beginning of the chapter, in the The data section. Now we'll import a DIBAVOD watershed layer into a database using ogr2ogr:
ogr2ogr -t_srs EPSG:32633 -f PostgreSQL "PG:dbname=mastering_postgis host=localhost user=osm password=osm" -lco GEOMETRY_NAME=geom -lco PRECISION=no -nln watershed_ord3 A08_Povodi_III.shp
Next, we will convert the Simple Feature geometry to a topology with 2-meter precision:
SELECT topology.CreateTopology('water_topology', 32633, 1, FALSE); SELECT topology.AddTopoGeometryColumn('water_topology','public','watershed_ord3','topogeom','POLYGON'); UPDATE watershed_ord3 SET topogeom = topology.toTopoGeom(geom,'water_topology',1,2); ...Read now
Unlock full access