Search in sources :

Example 1 with CswAxisOrder

use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswAxisOrder in project ddf by codice.

the class AbstractCswSource method setCoordinateOrder.

public void setCoordinateOrder(String coordinateOrder) {
    CswAxisOrder cswAxisOrder = CswAxisOrder.LON_LAT;
    if (StringUtils.isNotBlank(coordinateOrder)) {
        cswAxisOrder = CswAxisOrder.valueOf(CswAxisOrder.class, coordinateOrder);
        if (cswAxisOrder == null) {
            cswAxisOrder = CswAxisOrder.LON_LAT;
        }
    }
    LOGGER.debug("{}: Setting CSW coordinate order to {}", cswSourceConfiguration.getId(), cswAxisOrder);
    cswSourceConfiguration.setCswAxisOrder(cswAxisOrder);
}
Also used : CswAxisOrder(org.codice.ddf.spatial.ogc.csw.catalog.common.CswAxisOrder)

Example 2 with CswAxisOrder

use of org.codice.ddf.spatial.ogc.csw.catalog.common.CswAxisOrder in project ddf by codice.

the class CswRecordConverter method unmarshal.

@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
    Map<String, String> cswAttrMap = new CaseInsensitiveMap(DefaultCswRecordMap.getDefaultCswRecordMap().getCswToMetacardAttributeNames());
    Object mappingObj = context.get(CswConstants.CSW_MAPPING);
    if (mappingObj instanceof Map<?, ?>) {
        CswUnmarshallHelper.removeExistingAttributes(cswAttrMap, (Map<String, String>) mappingObj);
    }
    CswAxisOrder cswAxisOrder = CswAxisOrder.LON_LAT;
    Object cswAxisOrderObject = context.get(CswConstants.AXIS_ORDER_PROPERTY);
    if (cswAxisOrderObject != null && cswAxisOrderObject.getClass().isEnum()) {
        Enum value = (Enum) cswAxisOrderObject;
        cswAxisOrder = CswAxisOrder.valueOf(value.name());
    }
    Map<String, String> namespaceMap = null;
    Object namespaceObj = context.get(CswConstants.NAMESPACE_DECLARATIONS);
    if (namespaceObj instanceof Map<?, ?>) {
        namespaceMap = (Map<String, String>) namespaceObj;
    }
    Metacard metacard = CswUnmarshallHelper.createMetacardFromCswRecord(metacardType, reader, cswAxisOrder, namespaceMap);
    Object sourceIdObj = context.get(Core.SOURCE_ID);
    if (sourceIdObj instanceof String) {
        metacard.setSourceId((String) sourceIdObj);
    }
    return metacard;
}
Also used : CaseInsensitiveMap(org.apache.commons.collections.map.CaseInsensitiveMap) Metacard(ddf.catalog.data.Metacard) CswAxisOrder(org.codice.ddf.spatial.ogc.csw.catalog.common.CswAxisOrder) Map(java.util.Map) DefaultCswRecordMap(org.codice.ddf.spatial.ogc.csw.catalog.common.converter.DefaultCswRecordMap) CaseInsensitiveMap(org.apache.commons.collections.map.CaseInsensitiveMap)

Aggregations

CswAxisOrder (org.codice.ddf.spatial.ogc.csw.catalog.common.CswAxisOrder)2 Metacard (ddf.catalog.data.Metacard)1 Map (java.util.Map)1 CaseInsensitiveMap (org.apache.commons.collections.map.CaseInsensitiveMap)1 DefaultCswRecordMap (org.codice.ddf.spatial.ogc.csw.catalog.common.converter.DefaultCswRecordMap)1