|
From: Martin T. <mar...@ge...> - 2009-12-07 13:46:55
|
Dear All, Niels,
I was wondering if you ever solved your GML3 problem - I am trying a
simple way of converting a featureCollection into GML3, and I just
wanted to get the actual geometry string...
I am running into the same/similar issue:
I have:
QName ns = new
QName("http://www.opengis.net/gml","FeatureCollection","gml");
encoder.encode(collection, ns,out);
The name of the feature that it complains about ( Could not find element
declaration: (http://www.opengis.net/gml, myshp )) is picked from my SHP
file name, where I am reading the features from.
Stack trace:
ec 7, 2009 2:27:33 PM org.geotools.xml.impl.GetPropertyExecutor visit
WARNING: org.geotools.data.DefaultFeatureResults@158015a
(org.geotools.data.DefaultFeatureResults) is not of type
[Lorg.opengis.feature.simple.SimpleFeature;
Exception in thread "main" java.lang.RuntimeException: Could not find
element declaration: (http://www.opengis.net/gml, myshp )
at
org.geotools.gml2.FeaturePropertyExtractor.properties(FeaturePropertyExtractor.java:89)
at org.geotools.xml.Encoder.encode(Encoder.java:892)
at org.geotools.xml.Encoder.encode(Encoder.java:557)
at
ch.uzh.geo.tomko.viewshedserviceclient.SimpleShpXml.getGMLperGeomTest(SimpleShpXml.java:111)
at
ch.uzh.geo.tomko.viewshedserviceclient.SimpleShpXml.main(SimpleShpXml.java:54)
Also, what if I want to use my schema, but it is not accessible online
(and it seems to trigger error arrising from chema not found). Can I
construct one within geotools?
Cheers
Martin
|