use of net.opengis.gml.x32.CoordinateSystemAxisPropertyType in project arctic-sea by 52North.
the class GmlEncoderv321 method addAbstractCoordincateSystemValues.
private void addAbstractCoordincateSystemValues(AbstractCoordinateSystemType acst, AbstractCoordinateSystem abstractCoordinateSystem) throws EncodingException {
addDefinitonValues(acst, abstractCoordinateSystem);
acst.setAggregationType(AggregationType.Enum.forString(abstractCoordinateSystem.getAggregation().name()));
for (Referenceable<CoordinateSystemAxis> coordinateSystemAxis : abstractCoordinateSystem.getCoordinateSystemAxis()) {
CoordinateSystemAxisPropertyType csapt = acst.addNewAxis();
if (coordinateSystemAxis.isReference()) {
Reference reference = coordinateSystemAxis.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(csapt::setActuate);
reference.getArcrole().ifPresent(csapt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(csapt::setHref);
reference.getRole().ifPresent(csapt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(csapt::setShow);
reference.getTitle().ifPresent(csapt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(csapt::setType);
} else {
if (coordinateSystemAxis.isInstance()) {
Nillable<CoordinateSystemAxis> nillable = coordinateSystemAxis.getInstance();
if (nillable.isPresent()) {
XmlObject xml = createCoordinateSystemAxis(nillable.get(), EncodingContext.empty());
if (xml != null && xml instanceof CoordinateSystemAxisType) {
csapt.addNewCoordinateSystemAxis().set(xml);
} else {
csapt.setNil();
csapt.setNilReason(Nillable.missing().get());
}
} else {
csapt.setNil();
if (nillable.hasReason()) {
csapt.setNilReason(nillable.getNilReason().get());
} else {
csapt.setNilReason(Nillable.missing().get());
}
}
}
}
}
}
use of net.opengis.gml.x32.CoordinateSystemAxisPropertyType in project arctic-sea by 52North.
the class GmlEncoderv321 method createCoordinateSystemAxis.
private XmlObject createCoordinateSystemAxis(CoordinateSystemAxis coordinateSystemAxis, EncodingContext ctx) throws EncodingException {
CoordinateSystemAxisType csat = CoordinateSystemAxisType.Factory.newInstance();
addDefinitonValues(csat, coordinateSystemAxis);
csat.setAxisAbbrev(createCodeType(coordinateSystemAxis.getAxisAbbrev()));
csat.setAxisDirection(createCodeWithAuthorityType(coordinateSystemAxis.getAxisDirection()));
if (coordinateSystemAxis.isSetMinimumValue()) {
csat.setMinimumValue(coordinateSystemAxis.getMinimumValue());
}
if (coordinateSystemAxis.isSetMaximumValue()) {
csat.setMaximumValue(coordinateSystemAxis.getMaximumValue());
}
if (coordinateSystemAxis.isSetRangeMeaning()) {
csat.setRangeMeaning(createCodeWithAuthorityType(coordinateSystemAxis.getRangeMeaning()));
}
csat.setUom(coordinateSystemAxis.getUom());
if (ctx.has(XmlBeansEncodingFlags.DOCUMENT)) {
CoordinateSystemAxisDocument csad = CoordinateSystemAxisDocument.Factory.newInstance();
csad.setCoordinateSystemAxis(csat);
return csad;
} else if (ctx.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
CoordinateSystemAxisPropertyType csapt = CoordinateSystemAxisPropertyType.Factory.newInstance();
csapt.setCoordinateSystemAxis(csat);
return csapt;
}
return csat;
}
Aggregations