Issue Type: Bug Bug
Affects Versions: 2.7.5, 2.7.4
Assignee: Unassigned
Attachments: GTParsingTest.java
Components: xml, xsd-gml
Created: 12/Jul/12 3:12 AM
Description:

I tried to do some parsing of GML geometries via the built-in parser and dedicated configurations (org.geotools.gml3.GMLConfiguration, org.geotools.gml3.v3_2.GMLConfiguration).
Somehow, parsing of a GML 3.2 polygon is problematic due to SAX bindings. I am using exactly the same geometry markup for both GML 3.1.1 and 3.2.1 (see used xml below), but parsing fails for 3.2.1.

I traced down the cause and found the root of the issue inside the GML 3.2.1 schemas. While the 3.1.1 AbstractRingType has a defined baseType (AbstractGeometryType), the 3.2.1 version does not provide a base. So, the GeoTools XML handler resolves xsd:any as the base, linking it with the XSAnyTypeBinding. When it comes to actually resolving the value of the Node, the handler first resolves it for LinearRingTypeBinding (which is good) but then overrides it with the value from XSAnyTypeBinding (which is likely to be a String). This results in a ClassCastException later when the parser tries to cast it to a JTS LinearRing.

I have tested this with version 2.7.4 and 2.7.5, same behaviour in both versions. I have created a workaround (registering an additional binding for gml32:AbstractRingType, which returns Binding.OVERRIDE resulting in a break out of binding resolving). See attached JUnit test for details.

Environment: Windows 7 (Oracle JDK 1.6.0_31) / Ubuntu 12.04 (OpenJDK 1.6.0_24)
Project: GeoTools
Priority: Major Major
Reporter: Matthes Rieke
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to