Changes between Version 10 and Version 11 of Cookbook gdal
- Timestamp:
- Jan 29, 2010 11:20:00 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Cookbook gdal
v10 v11 30 30 If you really want to use Ogr2Ogr for this kind of conversion, below is the standard way to do it 31 31 Here the example should export the table riversegments 32 Cedric 32 33 {{{ 33 34 C:\OSGeo4W\bin\ogr2ogr -f "ESRI Shapefile" C:\base\basesig\essai.shp PG:"host=localhost user=postgres dbname=CCM password=postgres port=5433" "riversegments" 35 }}} 36 Celine (pwd to be precised) 37 {{{ 38 C:\OSGeo4W\bin\ogr2ogr -f "ESRI Shapefile" C:\base\basesig\essai.shp PG:"host=localhost user=postgres dbname=CCM password=PWD" "riversegments" 34 39 }}} 35 40 '' Cedric : celui ci marche mais j'ai eu du mal '' … … 37 42 Sometimes you have more than one geometry field in a table, and ESRI shape can only support one geometry field per shape. Also you may only want a subset of data. In these cases, you will need to select the geometry field to use. The most flexible way to do this is to use the -sql command which will take any sql statement. 38 43 {{{ 39 ogr2ogr -f "ESRI Shapefile" essai1.shp PG:"host=locahost user=postgres dbname=CCM password=postgres" -sql "SELECT gid, the_geom FROM riversegments"44 C:\OSGeo4W\bin\ogr2ogr -f "ESRI Shapefile" essai1.shp PG:"host=locahost user=postgres dbname=CCM password=postgres port=5433" -sql "SELECT gid, the_geom FROM riversegments" 40 45 }}} 41 46 Example snippet converting from PostGIS to KML