List,
we have a problem with the GML3 Parser (release 2.7.4):
Code:
----------
Configuration configuration = new GMLConfiguration();
configuration.getProperties().add(Parser.Properties.IGNORE_SCHEMA_LOCATION
);
configuration.getProperties().add(Parser.Properties.PARSE_UNKNOWN_ELEMENTS);
org.geotools.xml.Parser parser = new org.geotools.xml.Parser(configuration);
Object parsedData = parser.parse(new FileInputStream(file));
if(parsedData instanceof FeatureCollection){
fc = (FeatureCollection) parsedData;
....
--------
We have data generated by QGIS as input. The created GML is a mess and
not valid against the given (generic) gml schema nor are the namespaces
correct, but the GML3 parser can figure out the geometries for Points
but not for Polygons.
Why is that? What is wrong?
Points:
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/
http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"
xmlns:ogr="http://ogr.maptools.org/" xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord>
<gml:X>1205942.752754296</gml:X>
<gml:Y>1843910.199396594</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>1225676.152382844</gml:X>
<gml:Y>1847906.315814066</gml:Y>
</gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:qt_temp fid="F0">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1205942.752754295943305,1843910.199396593961865</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>1</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
<gml:featureMember>
<ogr:qt_temp fid="F1">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1210062.460401174612343,1847164.768437627935782</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>2</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
<gml:featureMember>
<ogr:qt_temp fid="F2">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1212369.496683426667005,1846670.403520002495497</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>3</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
<gml:featureMember>
<ogr:qt_temp fid="F3">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1216653.992636180249974,1846299.629831783473492</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>4</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
<gml:featureMember>
<ogr:qt_temp fid="F4">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1222174.40088299755007,1847247.162590565392748</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>5</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
<gml:featureMember>
<ogr:qt_temp fid="F5">
<ogr:geometryProperty>
<gml:Point>
<gml:coordinates>1225676.152382844360545,1847906.315814065979794</gml:coordinates>
</gml:Point>
</ogr:geometryProperty>
<ogr:id>6</ogr:id>
</ogr:qt_temp>
</gml:featureMember>
</ogr:FeatureCollection>
Polygons:
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/
http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"
xmlns:ogr="http://ogr.maptools.org/" xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord>
<gml:X>1205942.752754296</gml:X>
<gml:Y>1843910.199396594</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>1225676.152382844</gml:X>
<gml:Y>1847906.315814066</gml:Y>
</gml:coord>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<ogr:qt_temp fid="F0">
<ogr:geometryProperty>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>1205942.752754295943305,1843910.199396593961865
1210062.460401174612343,1847164.768437627935782
1225676.152382844360545,1847906.315814065979794
1205942.752754295943305,1843910.199396593961865</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ogr:geometryProperty>
<ogr:FID>0</ogr:FID>
</ogr:qt_temp>
</gml:featureMember>
</ogr:FeatureCollection>
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel