Search in sources :

Example 1 with ExtendedData

use of de.micromata.opengis.kml.v_2_2_0.ExtendedData in project ddf by codice.

the class KMLTransformerImpl method setExtendedData.

private void setExtendedData(Placemark placemark, Metacard metacard) {
    final ExtendedData extendedData = new ExtendedData();
    final Set<AttributeDescriptor> attributeDescriptors = metacard.getMetacardType().getAttributeDescriptors();
    for (AttributeDescriptor attributeDescriptor : attributeDescriptors) {
        final String attributeName = attributeDescriptor.getName();
        final Attribute attribute = metacard.getAttribute(attributeName);
        if (attribute != null) {
            Serializable attributeValue = convertAttribute(attribute, attributeDescriptor);
            if (attributeValue == null) {
                LOGGER.debug("Attribute {} converted to null value.", attributeName);
            } else {
                final Data data = getData(attributeName, attributeValue.toString());
                extendedData.addToData(data);
            }
        }
    }
    placemark.setExtendedData(extendedData);
}
Also used : Serializable(java.io.Serializable) ExtendedData(de.micromata.opengis.kml.v_2_2_0.ExtendedData) Attribute(ddf.catalog.data.Attribute) AttributeDescriptor(ddf.catalog.data.AttributeDescriptor) Data(de.micromata.opengis.kml.v_2_2_0.Data) ExtendedData(de.micromata.opengis.kml.v_2_2_0.ExtendedData)

Aggregations

Attribute (ddf.catalog.data.Attribute)1 AttributeDescriptor (ddf.catalog.data.AttributeDescriptor)1 Data (de.micromata.opengis.kml.v_2_2_0.Data)1 ExtendedData (de.micromata.opengis.kml.v_2_2_0.ExtendedData)1 Serializable (java.io.Serializable)1