Opened 14 years ago

Last modified 14 years ago

#3683 closed defect

OGR produces invalid GML element name for a OGRGeometryCollection object — at Version 1

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.7.3
Component: OGR_SF Version: unspecified
Severity: normal Keywords: GML multigeometry geometrycollection
Cc: warmerdam, crschmidt

Description (last modified by Even Rouault)

OGR currently writes <gml:GeometryCollection>, but this is not and has never been valid GML 2... The right element is <gml:MultiGeometry>. See http://schemas.opengeospatial.net/gml/2.1.2/geometry.xsd

The error is also confirmed because PostGis got it right :

ogrinfo PG:dbname=autotest -sql "select AsGML(GeomFromText('GEOMETRYCOLLECTION (POINT(0 1))'))"
returns
<gml:MultiGeometry><gml:geometryMember><gml:Point><gml:coordinates>0,1</gml:coordinates></gml:Point></gml:geometryMember></gml:MultiGeometry>

So it's time to fix things on the write side and validate against the GML schemas. I'll make the reading part tolerant to both old invalid syntax and new valid syntax.

I'll probably backport only the fix for the reading part in 1.7 branch, but not the fix for the writing part

Change History (1)

comment:1 by Even Rouault, 14 years ago

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