Thanks Even, -nlt POLYGON did indeed work for me.

Huge thanks as always for your (and every contributor’s) amazing work.

Andy


From: Even Rouault <even.roua...@spatialys.com>
Sent: 11 November 2022 14:07
To: Andrew Terry <andrew.te...@centremaps.co.uk>; gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] openfilegdb export


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@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>

https://lists.osgeo.org/mailman/listinfo/gdal-dev

--

http://www.spatialys.com

My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to