Have you tried including the gml namespace declarations in your
MultiLineString? That GeoTools parser generally likes them. Try
something like this:
>><ComplexValue schema="http://foo.bar/gml_polygon_schema.xsd"
xmlns:gml="http://www.opengis.net/gml">
>><gml:MultiLineString srsName="EPSG:4269">
>> <gml:lineStringMember>
>> <gml:LineString>
>> <gml:coordinates>-106,38 -106,35</gml:coordinates>
>> </gml:LineString>
>> </gml:lineStringMember>
>> <gml:lineStringMember>
>> <gml:LineString>
>> <gml:coordinates>-115,38 -115,35</gml:coordinates>
>> </gml:LineString>
>> </gml:lineStringMember>
>> </gml:MultiLineString>
>></ComplexValue>
This also may work:
>><ComplexValue schema="http://foo.bar/gml_polygon_schema.xsd">
>><xmlns="http://www.opengis.net/gml" MultiLineString srsName="EPSG:4269">
>> <lineStringMember>
>> <LineString>
>> <coordinates>-106,38 -106,35</coordinates>
>> </LineString>
>> </lineStringMember>
>> <lineStringMember>
>> <LineString>
>> <coordinates>-115,38 -115,35</coordinates>
>> </LineString>
>> </lineStringMember>
>> </MultiLineString>
>></ComplexValue>
If that's not it then it may be more involved, I don't remember how that
code works exactly. But I know that it just about requires the GML
namespace to be declared, and checks that the various gml properties are
in it. We're loose on filters, but not on GML.
Chris
Jonas Johansson wrote:
So that you know, the parsing goes through without problems.
ExcuteHandler also handles start(), end() and characters() and reads in
the document just fine.. But the geometry() method never gets called. I
checked that MultiLineString is indeed a type that would be handled by
the geotools code.
I'm clueless?
Jonas
On Thu, 2006-03-16 at 13:05 +0100, Jonas Johansson wrote:
On parsing a Geometry, what is it that I don't understand here?
If my ExecuteHandler implements the method geometry(Geometry g), and the
reader is reading some XML-stream containing the following extract:
....
<ComplexValue schema="http://foo.bar/gml_polygon_schema.xsd">
<MultiLineString srsName="EPSG:4269">
<lineStringMember>
<LineString>
<coordinates>-106,38 -106,35</coordinates>
</LineString>
</lineStringMember>
<lineStringMember>
<LineString>
<coordinates>-115,38 -115,35</coordinates>
</LineString>
</lineStringMember>
</MultiLineString>
</ComplexValue>
....
why isn't the method geometry ever called while parsing?
Basically, I set up the parser in this order:
InputSource requestSource = new InputSource(reader);
ExecuteHandler contentHandler = new ExecuteHandler();
GMLFilterGeometry geometryFilter = new
GMLFilterGeometry(contentHandler);
GMLFilterDocument documentFilter = new
GMLFilterDocument(geometryFilter);
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
ParserAdapter adapter = new ParserAdapter(parser.getParser());
adapter.setContentHandler(documentFilter);
adapter.parse(requestSource);
Thanks for any help!
Jonas
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
--
Chris Holmes
The Open Planning Project
thoughts at: http://cholmes.wordpress.com
begin:vcard
fn:Chris Holmes
n:Holmes;Chris
org:The Open Planning Project
adr:;;377 Broadway, 11th Floor;New York;NY;10013;USA
email;internet:[EMAIL PROTECTED]
title:VP, Strategic Development
x-mozilla-html:FALSE
url:http://topp.openplans.org
version:2.1
end:vcard