Hi everybody.
I have a problem when I try to visualize a Gml local file. The problem
depends on the coordinate system:
this is the GML file:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="
http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
xmlns:massgis="http://massgis.state.ma.us/featuretype" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://massgis.state.ma.us/featuretype
http://giswebservices.massgis.state.ma.us/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=massgis%3AAFREEMAN.GEOSERVER_TEST_PT
http://www.opengis.net/wfs
http://giswebservices.massgis.state.ma.us/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd
">
<gml:featureMember><massgis:AFREEMAN.GEOSERVER_TEST_PT
fid="AFREEMAN.GEOSERVER_TEST_PT.6093"><gml:boundedBy><gml:Box srsName="*
http://www.opengis.net/gml/srs/epsg.xml#4326*"><gml:coordinates xmlns:gml="
http://www.opengis.net/gml" decimal="." cs="," ts="
">276865.984215,886295.210856
276865.984215,886295.210856</gml:coordinates></gml:Box></gml:boundedBy><massgis:TEST_ID>44</massgis:TEST_ID><massgis:NAME>bbb</massgis:NAME><massgis:SHAPE><gml:MultiPoint
srsName="*http://www.opengis.net/gml/srs/epsg.xml#4326*"><gml:pointMember><gml:Point><gml:coordinates
xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts="
">276865.984215,886295.210856</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></massgis:SHAPE></massgis:AFREEMAN.GEOSERVER_TEST_PT></gml:featureMember></wfs:FeatureCollection>
it returns these exceptions:
java.lang.RuntimeException: Parsing failed for MultiPoint:
java.lang.AbstractMethodError:
org.geotools.referencing.factory.GeotoolsFactory.createCoordinateSystemAxis(Ljava/util/Map;Ljava/lang/String;Lorg/opengis/referencing/cs/AxisDirection;Ljavax/measure/unit/Unit;)Lorg/opengis/referencing/cs/CoordinateSystemAxis;
at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:164)
at
org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:220)
at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:186)
at
org.geotools.xml.impl.ElementHandlerImpl.endElement(ElementHandlerImpl.java:233)
at
org.geotools.xml.impl.ParserHandler.endElement(ParserHandler.java:628)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
at org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown
Source)
at org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.geotools.xml.Parser.parse(Parser.java:238)
at org.geotools.xml.Parser.parse(Parser.java:166)
at org.geotools.GML.decodeFeatureCollection(GML.java:451)
at testGML.main.test(main.java:29)
at testGML.main.main(main.java:16)
Caused by: java.lang.AbstractMethodError:
org.geotools.referencing.factory.GeotoolsFactory.createCoordinateSystemAxis(Ljava/util/Map;Ljava/lang/String;Lorg/opengis/referencing/cs/AxisDirection;Ljavax/measure/unit/Unit;)Lorg/opengis/referencing/cs/CoordinateSystemAxis;
at
org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateSystemAxis(DirectEpsgFactory.java:1699)
at
org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateSystemAxis(BufferedAuthorityFactory.java:741)
at
org.geotools.referencing.factory.epsg.DirectEpsgFactory.createAxesForCoordinateSystem(DirectEpsgFactory.java:1745)
at
org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateSystem(DirectEpsgFactory.java:1791)
at
org.geotools.referencing.factory.AbstractAuthorityFactory.createEllipsoidalCS(AbstractAuthorityFactory.java:465)
at
org.geotools.referencing.factory.BufferedAuthorityFactory.createEllipsoidalCS(BufferedAuthorityFactory.java:678)
at
org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:1920)
at
org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateReferenceSystem(BufferedAuthorityFactory.java:783)
at
org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:800)
at
org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:640)
at
org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:800)
at
org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731)
at
org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179)
at org.geotools.referencing.CRS.decode(CRS.java:489)
at org.geotools.referencing.CRS.decode(CRS.java:417)
at
org.geotools.gml2.bindings.GML2ParsingUtils.crs(GML2ParsingUtils.java:332)
at
org.geotools.gml3.bindings.GML3ParsingUtils.crs(GML3ParsingUtils.java:90)
at
org.geotools.gml3.bindings.AbstractGeometryTypeBinding.parse(AbstractGeometryTypeBinding.java:96)
at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:155)
... 19 more
but if I change the coordinate system with a random string of characters,
it works:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="
http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml"
xmlns:massgis="http://massgis.state.ma.us/featuretype" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://massgis.state.ma.us/featuretype
http://giswebservices.massgis.state.ma.us/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=massgis%3AAFREEMAN.GEOSERVER_TEST_PT
http://www.opengis.net/wfs
http://giswebservices.massgis.state.ma.us/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd
">
<gml:featureMember><massgis:AFREEMAN.GEOSERVER_TEST_PT
fid="AFREEMAN.GEOSERVER_TEST_PT.6093"><gml:boundedBy><gml:Box srsName="*
aaaaa*"><gml:coordinates xmlns:gml="http://www.opengis.net/gml" decimal="."
cs="," ts=" ">276865.984215,886295.210856
276865.984215,886295.210856</gml:coordinates></gml:Box></gml:boundedBy><massgis:TEST_ID>44</massgis:TEST_ID><massgis:NAME>bbb</massgis:NAME><massgis:SHAPE><gml:MultiPoint
srsName="*aasfgssa*"><gml:pointMember><gml:Point><gml:coordinates
xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts="
">276865.984215,886295.210856</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint></massgis:SHAPE></massgis:AFREEMAN.GEOSERVER_TEST_PT></gml:featureMember></wfs:FeatureCollection>
the code for the testing is the following:
java.net.URL url = new java.net.URL(
"file:///test.xml");
InputStream in = url.openStream();
GML gml = new GML(Version.WFS1_1);
SimpleFeatureCollection featureCollection = gml
.decodeFeatureCollection(in);
MapContext map = new DefaultMapContext();
map.setTitle("Quickstart");
map.addLayer(featureCollection, null);
// Now display the map
JMapFrame.showMap(map);
Why it doesn't work?
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel