Opened 10 years ago

Closed 10 years ago

#5421 closed defect (fixed)

OGR: Ignore POLYGON EMPTY inside MULTIPOLYGON in shapefile writer.

Reported by: peifer Owned by: warmerdam
Priority: normal Milestone: 1.11.0
Component: OGR_SF Version: unspecified
Severity: normal Keywords: gml PolygonPatch interior
Cc:

Description

Is this expected behaviour: the kmlfile conversion has no Error output, but the shapefile writer (correctly) points to broken geometries. See below

$ ogr2ogr -f kml GB_ModelArea_33.kml D_GB_Model_fixed.xml -sql "select * from AQD_ModelArea where gml_id='GB_ModelArea_33'" --config GML_GFS_TEMPLATE D_GB_ModelArea_fixed.gfs

OGR: OGROpen(D_GB_Model_fixed.xml/0x7fc99a408410) succeeded as GML.
KML: Attempt to create: GB_ModelArea_33.kml
GML: ResetReading()
GML: ResetReading()
OGRCT: PROJ >= 4.8.0 features enabled
OGRCT: Source: +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs
OGRCT: Target: +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
GML: ResetReading()
GML: ResetReading()
GML: ResetReading()
OGR2OGR: 1 features written in layer 'AQD_ModelArea'
GenSQL: 1 features read on layer 'AQD_ModelArea'.
GML: ResetReading()
GDAL: In GDALDestroy - unloading GDAL shared library.


$ ogr2ogr  GB_ModelArea_33.shp D_GB_Model_fixed.xml -sql "select * from AQD_ModelArea where gml_id='GB_ModelArea_33'" --config GML_GFS_TEMPLATE D_GB_ModelArea_fixed.gfs
OGR: OGROpen(D_GB_Model_fixed.xml/0x7fa7f2c083c0) succeeded as GML.
GML: ResetReading()
GML: ResetReading()
Shape: DBF Codepage = LDID/87 for GB_ModelArea_33.shp
Shape: Treating as encoding 'ISO-8859-1'.
GML: ResetReading()
GML: ResetReading()
GML: ResetReading()
OGR: Ignore POLYGON EMPTY inside MULTIPOLYGON in shapefile writer.
OGR: Ignore POLYGON EMPTY inside MULTIPOLYGON in shapefile writer.
OGR: Ignore POLYGON EMPTY inside MULTIPOLYGON in shapefile writer.
(...)

Change History (4)

comment:1 by peifer, 10 years ago

Here the xml and related gfs file: http://tinyurl.com/p87nah2

comment:2 by peifer, 10 years ago

Hmm. It looks to me that PolygonPatches with only interior rings are legal according to what I read at http://www.schemacentral.com/sc/niem21/e-gml32_PolygonPatch.html

The shapefile writer seems to refuse this geometry and throws errors, whereas other drivers (incl. kml) seem to silently re-declare the interior rings to exterior.

comment:3 by peifer, 10 years ago

Correction: the kml driver silently drops the only-interior-ring geometries.

comment:4 by Even Rouault, 10 years ago

Component: defaultOGR_SF
Keywords: gml PolygonPatch interior added
Milestone: 1.11.0
Resolution: fixed
Status: newclosed

trunk r27065 "GML: correctly deal with MultiSurface of Surface of PolygonPatch where a PolygonPatch has only interior ring(s) and no exterior ring (#5421)"

Note: See TracTickets for help on using tickets.