Opened 10 years ago
Closed 10 years ago
#2938 closed patch (fixed)
Patch for gml export of curved geometries
Reported by: | mhugent | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.5 |
Component: | postgis | Version: | 2.1.x |
Keywords: | Cc: |
Description
This patch fixes a bug in the gml curve type export. The code did not handle compoundcurve rings in curved polygons so far. The attached patch adds the 'if( subgeom→type == COMPOUNDTYPE )' switch to the curved polygon export.
Attachments (3)
Change History (10)
by , 10 years ago
Attachment: | out_gml_compoundcurve_patch.diff added |
---|
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Oh, my editor inserted those spaces. The attached patch now uses tabs everywhere. The relevant change is that there is a switch for compoundurves in 'asgml3_curvepoly_size' and in 'asgml3_curvepoly_buf'. To avoid a compile error, I additionally had to move the methods 'asgml3_compound_size','asgml3_compound_buf', 'asgml3_compound' to be in front of the two changed methods (this might look like reformatting, but it is necessary for compilation).
comment:4 by , 10 years ago
I believe this export generates invalid GML that breaks both XML validation and OGR GML importer. Child elements of "exterior" can be LinearRing or Ring, but not directly curveMember. This is true for both GML 3.1.1 and GML 3.2.1. XML validation of
<gml:Polygon xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"> <gml:exterior><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension="2">763650.6 189057.1 7636.35 189045.2 763650.549 189057.844 763650.6 189057.1</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember></gml:exterior></gml:Polygon>
with the xmlvalidate.py utility from mapserver msautotest (based on libxml2)
$ python pymod/xmlvalidate.py -ogc_schemas_location wxs/SCHEMAS_OPENGIS_NET test.gml
gives
Element '{http://www.opengis.net/gml}curveMember': This element is not expected. Expected is one of ( {http://www.opengis.net/gml}_Ring, {http://www.opengis.net/gml}LinearRing, {http://www.opengis.net/gml}Ring )., line 5
So the right export would be :
<gml:Polygon><gml:exterior><gml:Ring><gml:curveMember><gml:Curve><gml:segments><gml:LineStringSegment><gml:posList srsDimension="2">763650.6 189057.1 7636.35 189045.2 763650.549 189057.844 763650.6 189057.1</gml:posList></gml:LineStringSegment></gml:segments></gml:Curve></gml:curveMember></gml:Ring></gml:exterior></gml:Polygon>
comment:5 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
by , 10 years ago
Attachment: | curvepolygon_gml3_export_fix.patch added |
---|
Adds <gml:Ring> between <gml:exterior/interior> and <gml:curveMember>
comment:7 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks Even, trunk at r13116
Your patch unfortunately is mostly reformatting, removing the (postgis standard) tabs and replacing them with 4-spaces. Could you try a new patch that only includes the relevant alteration?