Hi,
I used Query tutorial (
http://docs.geotools.org/latest/userguide/tutorial/filter/query.html)
source to test creating KML from results of a query. Here is how I modified
the code:
private void filterFeatures() throws Exception {
String typeName = (String) featureTypeCBox.getSelectedItem();
SimpleFeatureSource source = dataStore.getFeatureSource(typeName);
Filter filter = CQL.toFilter(text.getText());
SimpleFeatureCollection features = source.getFeatures(filter);
FeatureCollectionTableModel model = new
FeatureCollectionTableModel(features);
table.setModel(model);
//added my code here
Encoder encoder = new Encoder(new KMLConfiguration());
encoder.setIndenting(true);
encoder.encode(features, KML.kml, System.out );
}
So, when I run query against shp file with points in it then kml output
contains points coordinates. But when I use shp file with polygons then
there are no coordinates in KML output (returns <MultiGeometry/>). So - I
think I'm missing something. Is SimpleFeatureCollection only for points and
cannot be used for complex features like polygons? How should I modify my
code to return KML with full set of polygon coordinates?
Thank you
Kol
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users