jsonWriter.key("id").value(feature.getID());
fType = feature.getFeatureType();
types = fType.getAttributeDescriptors();
GeometryDescriptor defaultGeomType = fType.getGeometryDescriptor();
if (crs == null && defaultGeomType != null)
crs = fType.getGeometryDescriptor().getCoordinateReferenceSystem();
jsonWriter.key("geometry");
Geometry aGeom = (Geometry) feature.getDefaultGeometry();
if (aGeom == null) {
// In case the default geometry is not set, we will
// just use the first geometry we find
for (int j = 0; j < types.size() && aGeom == null; j++) {
Object value = feature.getAttribute(j);
if (value != null && value instanceof Geometry) {
aGeom = (Geometry) value;
}
}
}
// Write the geometry, whether it is a null or not
if (aGeom != null) {
jsonWriter.writeGeom(aGeom);
hasGeom = true;
} else {
jsonWriter.value(null);
}
if (defaultGeomType != null)
jsonWriter.key("geometry_name").value(
defaultGeomType.getLocalName());
jsonWriter.key("properties");
jsonWriter.object();
for (int j = 0; j < types.size(); j++) {