From: Jody G. <jod...@gm...> - 2011-04-18 12:49:42
|
Nobody got back to you on this? The problem is the srsName for your second snippit of xml: srsName="SDO:8265" The srsName represents the spatial reference name and is usually of the format "standard":"code". Most often this is some form of "EPSG":"code" such as EPSG:4326. In this case your web service is referencing a standards body we don't know about in geotools - namely "SDO". I happen to know that SDO is the name of the spatial objects inside an oracle database; is there a chance the web service you are talking to is backed by oracle? On Thu, Feb 17, 2011 at 6:55 AM, Ryan Zoerb <ra...@us...> wrote: > I'm trying to parse a GML response from a web service, converting the > geometry into a GeometryCollection. Depending on the area of the returned > geometry, the web service will either return a gml:MultiPolygon element > (with several embedded gml:Polygon's), or just a single gml:Polygon (for > responses covering a small area). Here's the code I'm using to parse the > GML: > > org.geotools.xml.Configuration configuration = new > org.geotools.gml2.GMLConfiguration(); > org.geotools.xml.Parser parser = new > org.geotools.xml.Parser(configuration); > GeometryCollection geom = (GeometryCollection) parser.parse(new > StringReader(gml)); > > Parsing the gml:MultiPolygon works fine, but when parsing the single > gml:Polygon, it fails with: > > "Parsing failed for Polygon: > org.opengis.referencing.NoSuchAuthorityCodeException: Authority "SDO" is > unknown or doesn't match the supplied hints. Maybe it is defined in an > unreachable JAR file?" > > Here are examples of the gml: > > Works: > > <gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml" > srsName="SDO:8265"> > <gml:polygonMember> > <gml:Polygon> > <gml:outerBoundaryIs> > <gml:LinearRing> > <gml:coordinates decimal="." cs="," ts=" > ">-89.78,45.66,...</gml:coordinates> > </gml:LinearRing> > </gml:outerBoundaryIs> > </gml:Polygon> > </gml:polygonMember> > <gml:polygonMember> > <gml:Polygon> > <gml:outerBoundaryIs> > <gml:LinearRing> > <gml:coordinates decimal="." cs="," ts=" > ">-89.39,46.11,...</gml:coordinates> > </gml:LinearRing> > </gml:outerBoundaryIs> > </gml:Polygon> > </gml:polygonMember> > <gml:polygonMember> > <gml:Polygon> > <gml:outerBoundaryIs> > <gml:LinearRing> > <gml:coordinates decimal="." cs="," ts=" > ">-89.82,45.36,...</gml:coordinates> > </gml:LinearRing> > </gml:outerBoundaryIs> > </gml:Polygon> > </gml:polygonMember> > </gml:MultiPolygon> > > > Fails: > > <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="SDO:8265"> > <gml:outerBoundaryIs> > <gml:LinearRing> > <gml:coordinates decimal="." cs="," ts=" > ">-90.70,45.56,...</gml:coordinates> > </gml:LinearRing> > </gml:outerBoundaryIs> > </gml:Polygon> > > > Thank you for any help, > Ryan > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |