Opened 7 years ago

Last modified 7 years ago

#6917 closed defect

ogr2ogr creates and writes malformed multipolygon in FileGDB — at Version 1

Reported by: bespin Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version: unspecified
Severity: normal Keywords: ogr2ogr, FileGDB, MULTIPOLYGON
Cc:

Description (last modified by bespin)

ogr2ogr takes valid multipolygon wkt from any source and writes out malformed multipart geometry when using the FileGDB driver. It moves the 2nd exterior ring into the 1st exterior ring as an interior ring. It does this regardless of the source wkt ring orientation.

For example, Notice the movement of the () on the second feature part.

Source MULTIPOLYGON (((12 0, 17 0, 17 5, 12 5, 12 0)), ((12 6, 17 6, 17 11, 12 11, 12 6)))

is written out as MULTIPOLYGON (((12 0,12 5,17 5,17 0,12 0),(12 6,17 6,17 11,12 11,12 6)))

I tested this in the following gdal/filegdb sdk versions. All on various versions of windows

Command :

ogr2ogr -f "FileGDB" c:\temp\fgdbtest.gdb  c:\temp\ring_test.json -nln ring_test_from_json_01 -nlt POLYGON -append

A similar test writing out to shp will yield correct results.

ogr2ogr -f "ESRI Shapefile" c:\temp\ring_test_shp_from_json_01.shp  c:\temp\ring_test.json -nln ring_test_from_json_01 -nlt POLYGON

use ogrinfo -al to compare the difference.

Also, I am unable to recreate this using QGIS "Save As" or through python-ogr bindings by manually writing out a feature. It appears to be limited to ogr2ogr + the FileGDB writer.

Attached is the geojson used in the examples. 3 of the 5 features are multipolygons, each with two exterior rings. All 3 have different ring orientation in the json but all will exhibit the same export behavior.

Change History (2)

by bespin, 7 years ago

Attachment: ring_test.json added

comment:1 by bespin, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.