[gdal-dev] problems converting gdb to shp

Even Rouault even.rouault at mines-paris.org
Thu Jan 31 12:56:21 PST 2013


Le jeudi 31 janvier 2013 21:49:03, Tyler Mitchell a écrit :
> Hi Sarah,
> 
> Be sure to quote "ESRI Shapefile" or it will use "shapefile" as the output
> filename.
> 
> Since Shapefile is default, you can remove the -f ... stuff altogether to
> simplify.
> 
> As far as I can tell that's your main problem there.  I don't have a GDB
> install to test against though.

This will not be enough. The -where "ogr_geometry = 'POINT'" will not work 
with the FileGDB driver since it will be evaluated directly with the FGDB SDK, 
but that where clause is specific to the OGRSQL dialect.

So something like :

ogr2ogr points.shp input.gdb  -a_srs EPSG:4326 -sql "SELECT * FROM 
the_layer_name_in_the_gdb_datasource WHERE ogr_geometry='POINT'" -dialect 
OGRSQL

(tested with GDAL 1.10dev)

> 
> Tyler
> 
> On 2013-01-31, at 12:30 PM, Sarah Zatko wrote:
> > I’m trying to use the –where command in ogr2ogr (1.9.0) to separate out
> > different geometry types, as was described in the FAQ for converting gdb
> > to shp files, but when I do the following command
> > 
> > Ogr2ogr.exe -f ESRI Shapefile points.shp input.gdb -a_srs EPSG:4326 -nln
> > points -where 'ogr_geometry="POINT"'
> > 
> > it thinks that the –where… part of the command is the name of a gdb
> > layer.
> > 
> > I tried moving the –where part of the command earlier, to before the –f
> > argument, but then it just hangs and doesn’t complete at all.
> > 
> > Any thoughts on what I’m doing wrong here?
> > 
> > Also, when I try to go from shapefile to geodb in Windows, it only works
> > if I’m running as administrator.  Is that just a requirement?  It
> > doesn’t require root in Linux.
> > 
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> Tyler Mitchell
> Engineering Director
> Actian Corporation
> tyler.mitchell at actian.com
> 
> MOBILE 250-303-1831
> SKYPE spatialguru
> www.actian.com


More information about the gdal-dev mailing list