|
From: <av...@sa...> - 2004-01-31 01:10:52
|
Ive been studying geotools2 for a few weeks and at this point
im lost about not sure yet about current support of geotools2 with GML2.0
archives.
This is the content of my gml2.0 archive:
<cityMember>
<River>
<gml:description>The river that runs through Cambridge.</gml:description>
<gml:name>Cam</gml:name>
<gml:centerLineOf>
<gml:Point>
<gml:coordinates>141.000000,-38.000000 </gml:coordinates>
</gml:Point>
<gml:LinearRing>
<gml:coordinates>
2,20 6,30 17,30 23,20 20,10 10,10 2,20
</gml:coordinates>
</gml:LinearRing>
<gml:LineString gid="8" srsName="http://?/epsg.xml#ESPG:4326">
<gml:coordinates>
0,10 10,20 30,30
</gml:coordinates>
</gml:LineString>
<gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coord>
<gml:X>0</gml:X>
<gml:Y>50</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>70</gml:X>
<gml:Y>60</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>100</gml:X>
<gml:Y>50</gml:Y>
</gml:coord>
</gml:LineString>
</gml:centerLineOf>
</River>
</cityMember>
...and the thing is that even before trying to render the scene,
y code
DataSource ds = new GMLDataSource(url);
FeatureCollection featureCollection = ds.getFeatures(Query.ALL);
FeatureIterator features = featureCollection.features();
System.out.println("Got " + featureCollection.size() + " features");
while (features.hasNext()) {
System.out.println("feature is " + features.next());
}
System.out.println("\n");
obtaining this in the output console (<gml:coord> node dissapeared):
feature is Feature[ id=feature-31522607 , River/description=The river that runs through Cambridge. , River/name=Cam
, River/centerLineOf=POINT (141 -38) , River=LINESTRING (2 20, 6 30, 17 30, 23 20, 20 10, 10 10, 2 20) ,
geometry=LINESTRING (0 10, 10 20, 30 30) ]
...and with this code:
TestHandler contentHandler = new TestHandler();
GMLFilterGeometry geometryFilter = new GMLFilterGeometry(contentHandler);
GMLFilterDocument documentFilter = new GMLFilterDocument(geometryFilter);
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
parser.setContentHandler(documentFilter);
parser.parse(gmlFile);
i obtained the following output:
here is the geometry: POLYGON ((0 0, 0 -1, -1 -1, -1 0, 0 0))
here is the geometry: POINT (141 -38)
here is the geometry: LINESTRING (2 20, 6 30, 17 30, 23 20, 20 10, 10 10, 2 20)
here is the geometry: LINESTRING (0 10, 10 20, 30 30)
...missing the last LineString with the gml:coord node.
so.. im able to obtain features of gml1.0 archives, but, as i see in the FAQ about supporting
gml2.0 format, am i using something wrong?? wrong classes? im not
talking about render yet, at last there are something in geotools2
recognizing the GML2.0 format, at least recognize the geometrics
features(gml:coord, xsd, and so on)
thanks another time.
Alberto Vivar Guerra
Departamento de Sistemas de Negocio en Red
E-mail: av...@sa...
Extensión: 51448
Alberto Vivar Guerra
Departamento de Sistemas de Negocio en Red
E-mail: av...@sa...
Extensión: 51448
SATEC, S.A.
Avenida de Europa, 34 A
28023 Aravaca (Madrid)
Teléfono: +34 91 708 90 00
Fax : +34 91 708 90 90
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 6.5.8ckt http://www.ipgpp.com/
mQGiBD/gqhoRBADkW8YZlM8BYRivP7gA9Muu6ov8ozh9sRMxDs5uFUZ9/LqJE+yi
YQbjnmHM6buITXai+YyqOx0LHLVeehYpoWaOxf16EUS5gBYLAOcxaa7UvGCaWe1s
V5hcQiRqDBQPdHuptrf6hrjPJbjDutECgUKpaa7jmSaRSyNkbEgdNrkIzQCg/8xE
Skz6cOX9mAjsU8eydNv+LN8EAKSdE9FkrXpZ9f9qEwsSB+jfVTCqQ5XIrkDngJGV
zm4WcS+CX+7g1AmzwhcpsuXk8MGtogV69rYlOh0PsSkj7Exm9FxE+s+tugLB5J7J
basOdBuNkPXe7jNA6UJ6JeKznrPd+tX58JFUh9nUyIR6IVmx/AmANzN0yq+FcDSd
NZxwBAC0cpEG1LB19Tr0AlqX3GrqGQjrq2zCmF5kUqNOXAD/UwQachgpwy1lHbmJ
p48OZATDP0smHxIbERYYtsezAaF57E5g+eDGVza3iD63fRliF5powl/i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