[postgis-devel] [PostGIS] #1059: Regress failure after gserialized: ST_ASGML/ST_GeomFromGML POINT empty invalid GML
PostGIS
trac at osgeo.org
Sat Jan 28 03:14:27 PST 2012
#1059: Regress failure after gserialized: ST_ASGML/ST_GeomFromGML POINT empty
invalid GML
---------------------+------------------------------------------------------
Reporter: robe | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.0.0
Component: postgis | Version: trunk
Keywords: gml |
---------------------+------------------------------------------------------
Comment(by rouault):
<gml:Point/> is invalid GML 2. See :
pointempty.xsd :
{{{
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://ogr.maptools.org/"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified"
version="1.0">
<xs:import namespace="http://www.opengis.net/gml"
schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType"
substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="pointempty" type="ogr:pointempty_Type"
substitutionGroup="gml:_Feature"/>
<xs:complexType name="pointempty_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty"
type="gml:GeometryPropertyType" nillable="true" minOccurs="0"
maxOccurs="1"/>
<xs:element name="foo" nillable="true" minOccurs="0"
maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
}}}
pointempty.gml (hand edited since OGR doesn't allow to write <gml:Point/>
:
{{{
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ pointempty.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:null>missing</gml:null>
</gml:boundedBy>
<gml:featureMember>
<ogr:pointempty fid="pointempty.0">
<ogr:geometryProperty><gml:Point /></ogr:geometryProperty>
<ogr:foo>bar</ogr:foo>
</ogr:pointempty>
</gml:featureMember>
</ogr:FeatureCollection>
}}}
Now, let's validate the file :
{{{
$ LD_LIBRARY_PATH=/home/even/install-libxml2-2.7.8git/lib xmllint --schema
pointempty.xsd pointempty.gml -noout
pointempty.gml:12: element Point: Schemas validity error : Element
'{http://www.opengis.net/gml}Point': Missing child element(s). Expected is
one of ( {http://www.opengis.net/gml}coord,
{http://www.opengis.net/gml}coordinates ).
pointempty.gml fails to validate
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1059#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list