[gdal-dev] Writing Geometrycollection to ShapeFile datasource

dmel danley.dmello at bentley.com
Mon Oct 16 09:08:57 PDT 2017


Hi,

I am implementing export service to export the geometries from our system to
ShapeFile using OGR 1.11 library.

The service create GeoJSON datasource from the JSON input, and then for each
feature in the GeoJSON datasource it creates feature in ShapeFile
datasourse.

It all works well when all the features in the GeoJson are simple Geometry
(POINT, LINESTRING, POLYGON) (Note: we don’t support mix geometries)
But if the GeoJson data contains Point and GeometryCollection of Points,
then Shapefile driver raise the error:

“Attempt to write non-point( GeometryCollection ) geometry to POINT type
shapefile.”

Is this by design or bug because this works for Linestring and
GeometryCollection of Linestring ( same for polygon).
If this is by design, what the best way to handle this.



Thanks
Danley




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list