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);
}
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;
}
Aggregations