use of net.opengis.ows.x11.CodeType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getVesselStorageCharacteristic.
public static VesselStorageCharacteristic getVesselStorageCharacteristic() {
VesselStorageCharacteristic vesselStorageCharacteristic = new VesselStorageCharacteristic();
List<CodeType> typeCodes = Arrays.asList(getCodeType("CONTAINER", "VESSEL_STORAGE_TYPE"));
IDType id = getIdType("ID 1", "687yu5-tught6-thfyr-5yt74e");
vesselStorageCharacteristic.setID(id);
vesselStorageCharacteristic.setTypeCodes(typeCodes);
return vesselStorageCharacteristic;
}
use of net.opengis.ows.x11.CodeType in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeServiceIdentification.
private XmlObject encodeServiceIdentification(OwsServiceIdentification serviceIdentification) throws EncodingException {
ServiceIdentification serviceIdent;
/* TODO check for required fields and fail on missing ones */
serviceIdent = ServiceIdentification.Factory.newInstance();
serviceIdentification.getAccessConstraints().forEach(serviceIdent::addAccessConstraints);
if (!serviceIdentification.getFees().isEmpty()) {
serviceIdent.setFees(serviceIdentification.getFees().iterator().next());
}
CodeType xbServiceType = serviceIdent.addNewServiceType();
xbServiceType.setStringValue(serviceIdentification.getServiceType().getValue());
if (serviceIdentification.getServiceType().getCodeSpace().isPresent()) {
xbServiceType.setCodeSpace(serviceIdentification.getServiceType().getCodeSpace().get().toString());
}
encodeMultilingualString(serviceIdentification.getTitle(), serviceIdent::addNewTitle);
encodeMultilingualString(serviceIdentification.getAbstract(), serviceIdent::addNewAbstract);
serviceIdentification.getServiceTypeVersion().stream().forEach(serviceIdent::addServiceTypeVersion);
serviceIdentification.getProfiles().stream().map(URI::toString).forEach(serviceIdent::addProfile);
serviceIdentification.getKeywords().stream().collect(groupingBy(OwsKeyword::getType, mapping(OwsKeyword::getKeyword, toList()))).forEach((type, keywords) -> encodeOwsKeywords(type, keywords, serviceIdent.addNewKeywords()));
return serviceIdent;
}
use of net.opengis.ows.x11.CodeType in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeGmdQuantitativeResult.
private void encodeGmdQuantitativeResult(DQResultPropertyType xbResult, GmdQuantitativeResult gmdQuantitativeResult) {
DQQuantitativeResultType dqQuantitativeResultType = (DQQuantitativeResultType) xbResult.addNewAbstractDQResult().substitute(QN_GMD_QUANTITATIVE_RESULT, DQQuantitativeResultType.type);
GmlBaseUnit unit = gmdQuantitativeResult.getUnit();
UnitOfMeasurePropertyType valueUnit = dqQuantitativeResultType.addNewValueUnit();
BaseUnitType xbBaseUnit = (BaseUnitType) valueUnit.addNewUnitDefinition().substitute(QN_GML_BASE_UNIT, BaseUnitType.type);
CodeType xbCatalogSymbol = xbBaseUnit.addNewCatalogSymbol();
xbCatalogSymbol.setCodeSpace(unit.getCatalogSymbol().getCodeSpace().toString());
xbCatalogSymbol.setStringValue(unit.getCatalogSymbol().getValue());
xbBaseUnit.setId(unit.getId());
xbBaseUnit.addNewUnitsSystem().setHref(unit.getUnitSystem());
xbBaseUnit.addNewIdentifier().setCodeSpace(unit.getIdentifier());
if (gmdQuantitativeResult.isSetValueNilReason()) {
dqQuantitativeResultType.addNewValue().setNilReason(gmdQuantitativeResult.getValueNilReason().name());
} else {
XmlCursor cursor = dqQuantitativeResultType.addNewValue().addNewRecord().newCursor();
cursor.toNextToken();
cursor.insertChars(gmdQuantitativeResult.getValue());
cursor.dispose();
}
}
use of net.opengis.ows.x11.CodeType in project arctic-sea by 52North.
the class GmlEncoderv321 method createCodeType.
private CodeType createCodeType(org.n52.shetland.ogc.gml.CodeType sosCodeType) throws EncodingException {
if (!sosCodeType.isSetValue()) {
throw missingValueParameter(CodeType.class.getName());
}
CodeType codeType = CodeType.Factory.newInstance(getXmlOptions());
codeType.setStringValue(sosCodeType.getValue());
codeType.setCodeSpace(Optional.ofNullable(sosCodeType.getCodeSpace()).map(URI::toString).filter(Predicates.not(String::isEmpty)).orElse(OGCConstants.UNKNOWN));
return codeType;
}
Aggregations