KMLEncoder encoder = new KMLEncoder();
SimpleFeatureCollection fcObj = (SimpleFeatureCollection) obj;
CoordinateReferenceSystem crs = fcObj.getSchema().getCoordinateReferenceSystem();
// gpx is defined only in wgs84
if (crs != null && !CRS.equalsIgnoreMetadata(crs, DefaultGeographicCRS.WGS84)) {
fcObj = new ReprojectingFeatureCollection(fcObj, DefaultGeographicCRS.WGS84);
}
List<SimpleFeatureCollection> collections = new ArrayList<SimpleFeatureCollection>();
collections.add(fcObj);
KmlEncodingContext context = new WFSKmlEncodingContext(gs.getService(WFSInfo.class),