return doc;
}
private void addSchema(Document doc, String id, SimpleFeatureType featureType) {
Schema schema = doc.createAndAddSchema();
schema.setId(id);
schema.setName(id);
for (AttributeDescriptor ad : featureType.getAttributeDescriptors()) {
// skip geometry attributes
if (ad instanceof GeometryDescriptor) {
continue;
}
SimpleField field = schema.createAndAddSimpleField();
field.setName(ad.getLocalName());
field.setType(getKmlFieldType(ad));
}
}