[gdal-dev] openfilegdb export

Even Rouault even.rouault at spatialys.com
Fri Nov 11 06:07:11 PST 2022


Andrew,

Can you paste the output of

ogrinfo -al -so PG:"dbname=dbname port=5432 host=dbhost user=dbusr" 
--optfile sql_filter.sql

so we can see the layer geometry type. I presume it is unknown.

GeoPackage supports geometry columns with unknown geometry type.

Shapefile requires a precise geometry type, but the shapefile driver has 
a heuristics to use the geometry type of the first feature as the layer 
geometry type, when the declared layer geometry type is unknown. The 
OpenFileGDB driver doesn't have that heuristics.

It is likely you need to add an explicit -nlt POLYGON or -nlt 
MULTIPOLYGON to your ogr2ogr invokation

Even


Le 11/11/2022 à 14:53, Andrew Terry a écrit :
>
> Hi,
>
> Trying out the export to OpenFileGDB, using GDAL 3.7.0dev-5a6f99a78b 
> installed with OSGeo4W
>
> ogr2ogr -f "OpenFileGDB" test_filegdb.gdb PG:"dbname=dbname port=5432 
> host=dbhost user=dbusr" --optfile sql_filter.sql
>
> This works for SHP and GeoPackage and the output is a EPSG 27700 
> Polygon geometries.
>
> I get the following error:
>
> ERROR 6: Unsupported geometry type
>
> ERROR 1: Terminating translation prematurely after failed
>
> translation from sql statement.
>
> What geometry type is expected? I did try ST_Multi and ST_Force3D to 
> see whether multipolygons etc are expected.
>
> Hopefully I’m not missing something too obvious.
>
> Thanks
>
> Andy
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221111/967c0d35/attachment.htm>


More information about the gdal-dev mailing list