use of net.opengis.gml.x32.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.gml.x32.CodeType in project arctic-sea by 52North.
the class SwesDecoderv20 method parseRelatedFeature.
private List<SwesFeatureRelationship> parseRelatedFeature(final RelatedFeature[] relatedFeatureArray) throws DecodingException {
List<SwesFeatureRelationship> sosRelatedFeatures = new ArrayList<>(relatedFeatureArray.length);
for (final RelatedFeature relatedFeature : relatedFeatureArray) {
final SwesFeatureRelationship sosFeatureRelationship = new SwesFeatureRelationship();
final FeaturePropertyType fpt = relatedFeature.getFeatureRelationship().getTarget();
if (fpt.getHref() != null && !fpt.getHref().isEmpty()) {
final String identifier = fpt.getHref();
final AbstractSamplingFeature feature = new SamplingFeature(new CodeWithAuthority(identifier));
if (fpt.getTitle() != null && !fpt.getTitle().isEmpty()) {
feature.setName(Lists.newArrayList(new CodeType(fpt.getTitle())));
}
if (checkForRequestUrl(fpt.getHref())) {
feature.setUrl(fpt.getHref());
}
feature.setFeatureType(OGCConstants.UNKNOWN);
sosFeatureRelationship.setFeature(feature);
} else {
final Object decodedObject = decodeXmlElement(fpt);
if (decodedObject instanceof AbstractSamplingFeature) {
sosFeatureRelationship.setFeature((AbstractSamplingFeature) decodedObject);
} else {
throw new DecoderResponseUnsupportedException(fpt.xmlText(), decodedObject);
}
}
sosFeatureRelationship.setRole(relatedFeature.getFeatureRelationship().getRole());
sosRelatedFeatures.add(sosFeatureRelationship);
}
return sosRelatedFeatures;
}
use of net.opengis.gml.x32.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.gml.x32.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.gml.x32.CodeType in project arctic-sea by 52North.
the class GmlEncoderv321 method createAbstractGeometry.
private AbstractGeometryType createAbstractGeometry(AbstractGeometry element, EncodingContext ctx) throws EncodingException {
XmlObject xbGeometry = createPosition(element.getGeometry(), ctx);
AbstractGeometryType abstractGeometryType = null;
if (xbGeometry instanceof AbstractGeometryType) {
abstractGeometryType = (AbstractGeometryType) xbGeometry;
} else if (xbGeometry instanceof GeometryPropertyType) {
abstractGeometryType = ((GeometryPropertyType) xbGeometry).getAbstractGeometry();
} else {
throw new UnsupportedEncoderInputException(this, element);
}
if (element.isSetIdentifier()) {
abstractGeometryType.setIdentifier(createCodeWithAuthorityType(element.getIdentifierCodeWithAuthority()));
}
if (element.isSetName()) {
for (org.n52.shetland.ogc.gml.CodeType codeType : element.getName()) {
abstractGeometryType.addNewName().set(createCodeType(codeType));
}
}
if (element.isSetDescription()) {
abstractGeometryType.addNewDescription().setStringValue(element.getDescription());
}
return abstractGeometryType;
}
Aggregations