Please see my code, I've used examples found in WEB.
Encoder encoder = new Encoder(new KMLConfiguration());
encoder.setIndenting(true);
SimpleFeatureTypeBuilder typeBuilder = new
SimpleFeatureTypeBuilder();
typeBuilder.setName("poi");
typeBuilder.add("geometry", Polygon.class,
DefaultGeographicCRS.WGS84);
SimpleFeatureType TYPE = typeBuilder.buildFeatureType();
SimpleFeatureBuilder featureBuilder = new
SimpleFeatureBuilder(TYPE);
DefaultFeatureCollection features = new DefaultFeatureCollection();
for(int i=0; i<10; i++){
featureBuilder.add(geometryList.get(i));//Ellipses, sectors are
here...
features.add( featureBuilder.buildFeature(String.valueOf(i+1))
);
}
encoder.encode(features, KML.Polygon, System.out);//EXCEPTION HERE
}
And an exception:
2013-02-13 18:57:34 INFO SingleRetailsStoreIntersectionVisualizationTest:66
- geometryList.size 4341
java.lang.RuntimeException: Failed to get property: id
at
org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:105)
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.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:47)
at
org.geotools.xml.impl.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:32)
at org.geotools.xml.Encoder.encode(Encoder.java:902)
at org.geotools.xml.Encoder.encode(Encoder.java:603)
at
geo.visualize.SingleRetailsStoreIntersectionVisualizationTest.visualizeRetailStoreMC7700001(SingleRetailsStoreIntersectionVisualizationTest.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
--
View this message in context:
http://osgeo-org.1560.n6.nabble.com/Error-while-trying-to-Encode-feature-collection-to-KML-java-lang-RuntimeException-Failed-to-get-propd-tp5033979.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users