use of org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20FeatureCollection in project ddf by codice.
the class FeatureCollectionConverterWfs20 method marshal.
@Override
public void marshal(Object value, HierarchicalStreamWriter writer, MarshallingContext context) {
if (value != null) {
Wfs20FeatureCollection wfc = (Wfs20FeatureCollection) value;
String schemaLoc = generateSchemaLocationFromMetacards(wfc.getMembers(), prefixToUriMapping);
for (Entry<String, String> entry : prefixToUriMapping.entrySet()) {
writer.addAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + entry.getKey(), entry.getValue());
}
writer.addAttribute(Wfs20Constants.ATTRIBUTE_SCHEMA_LOCATION, schemaLoc);
Geometry allGeometry = getBounds(wfc.getMembers());
if (!allGeometry.isEmpty()) {
XmlNode.writeEnvelope(Wfs20Constants.GML_PREFIX + ":" + "boundedBy", context, writer, allGeometry.getEnvelopeInternal());
}
for (Metacard mc : wfc.getMembers()) {
writer.startNode(Wfs20Constants.GML_PREFIX + ":" + FEATURE_MEMBER);
context.convertAnother(mc);
writer.endNode();
}
} else {
LOGGER.debug("Incoming value was null");
}
}
Aggregations