|
From: Michael W. <mp...@ho...> - 2009-06-24 23:27:44
|
Hi, all, I am a new Geotools user, who want to parse GML file using Geotools library. After reading the tutorial page on http://docs.codehaus.org/display/GEOTDOC/GML+XML+Support, and searching some articles on the mailing list, I am able to parse some of gml files. However, some other gml files can not be parsed by Geotools. All the gml files are all passed by the XmlSpy validation, so they should be both well-formed and validated. I appreciate if anyone can help me out about this parsing problem. The following sensorML.xml file cannot be parsed by my my Java program TestGeoTools2.java, which uses GeoTools. The sensorML.xml reference an external schema file. My GeoTools version is 2.5.4. http://n2.nabble.com/file/n3152178/TestGeoTools2.java TestGeoTools2.java http://n2.nabble.com/file/n3152178/sensorML.xml sensorML.xml The Exception that I got is as following: Jun 24, 2009 4:04:40 PM org.geotools.xml.impl.ParserHandler startElement WARNING: Error parsing: http://schemas.opengis.net/sensorML/1.0.1/sensorML.xsd Jun 24, 2009 4:04:40 PM org.geotools.xml.impl.ParserHandler startElement WARNING: Could not find a schema Jun 24, 2009 4:04:54 PM org.geotools.xml.impl.ParserHandler startElement INFO: Could not find declaration for: {http://www.opengis.net/sensorML/1.0.1}SensorML. Creating a mock element declaration and parsing anyways... Jun 24, 2009 4:04:54 PM org.geotools.xml.impl.ParserHandler startElement ... ... Exception in thread "main" java.lang.ClassCastException: java.util.HashMap cannot be cast to org.geotools.feature.FeatureCollection at TestGeoTools2.main(TestGeoTools2.java:20) -- View this message in context: http://n2.nabble.com/GML-Parser-problem-%28cannot-parse-some-gml-files%29-tp3152178p3152178.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |