use of net.opengis.gml.x32.VerticalDatumPropertyType in project arctic-sea by 52North.
the class GmlEncoderv321 method createVerticalDatum.
private XmlObject createVerticalDatum(VerticalDatum verticalDatum, EncodingContext ctx) throws EncodingException {
VerticalDatumType vdt = VerticalDatumType.Factory.newInstance();
addAbstractDatumValues(vdt, verticalDatum, ctx);
if (ctx.has(XmlBeansEncodingFlags.DOCUMENT)) {
VerticalDatumDocument vdd = VerticalDatumDocument.Factory.newInstance();
VerticalDatumPropertyType vdpt = VerticalDatumPropertyType.Factory.newInstance();
vdpt.setVerticalDatum(vdt);
vdd.setVerticalDatum(vdpt);
return vdd;
} else if (ctx.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
VerticalDatumPropertyType vdpt = VerticalDatumPropertyType.Factory.newInstance();
vdpt.setVerticalDatum(vdt);
return vdpt;
}
return vdt;
}
use of net.opengis.gml.x32.VerticalDatumPropertyType in project arctic-sea by 52North.
the class AbstractWmlEncoderv20 method addVerticalDatum.
private void addVerticalDatum(MonitoringPointType mpt, List<Referenceable<VerticalDatum>> verticalDatums) throws EncodingException {
for (Referenceable<VerticalDatum> verticalDatum : verticalDatums) {
VerticalDatumPropertyType vdpt = mpt.addNewVerticalDatum();
if (verticalDatum.isReference()) {
Reference reference = verticalDatum.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vdpt::setActuate);
reference.getArcrole().ifPresent(vdpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(vdpt::setHref);
reference.getRole().ifPresent(vdpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vdpt::setShow);
reference.getTitle().ifPresent(vdpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vdpt::setType);
} else {
if (verticalDatum.isInstance()) {
Nillable<VerticalDatum> nillable = verticalDatum.getInstance();
if (nillable.isPresent()) {
XmlObject xml = encodeGML(nillable.get());
if (xml != null && xml instanceof VerticalDatumType) {
vdpt.setVerticalDatum((VerticalDatumType) xml);
} else {
vdpt.setNil();
vdpt.setNilReason(Nillable.missing().get());
}
} else {
vdpt.setNil();
if (nillable.hasReason()) {
vdpt.setNilReason(nillable.getNilReason().get());
} else {
vdpt.setNilReason(Nillable.missing().get());
}
}
}
}
}
}
use of net.opengis.gml.x32.VerticalDatumPropertyType in project arctic-sea by 52North.
the class GmlEncoderv321 method createVerticalCRS.
private XmlObject createVerticalCRS(VerticalCRS verticalCRS, EncodingContext ctx) throws EncodingException {
VerticalCRSType vcrst = VerticalCRSType.Factory.newInstance();
addAbstractCRSValues(vcrst, verticalCRS);
// verticalCS
Referenceable<VerticalCS> verticalCS = verticalCRS.getVerticalCS();
VerticalCSPropertyType vcspt = vcrst.addNewVerticalCS();
if (verticalCS.isReference()) {
Reference reference = verticalCS.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vcspt::setActuate);
reference.getArcrole().ifPresent(vcspt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(vcspt::setHref);
reference.getRole().ifPresent(vcspt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vcspt::setShow);
reference.getTitle().ifPresent(vcspt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vcspt::setType);
} else {
if (verticalCS.isInstance()) {
Nillable<VerticalCS> nillable = verticalCS.getInstance();
if (nillable.isPresent()) {
XmlObject xml = createVerticalCS(nillable.get(), EncodingContext.empty());
if (xml != null && xml instanceof VerticalCSType) {
vcspt.set((VerticalCSType) xml);
} else {
vcspt.setNil();
vcspt.setNilReason(Nillable.missing().get());
}
} else {
vcspt.setNil();
if (nillable.hasReason()) {
vcspt.setNilReason(nillable.getNilReason().get());
} else {
vcspt.setNilReason(Nillable.missing().get());
}
}
}
}
// verticalDatum
Referenceable<VerticalDatum> verticalDatum = verticalCRS.getVerticalDatum();
VerticalDatumPropertyType vdpt = vcrst.addNewVerticalDatum();
if (verticalDatum.isReference()) {
Reference reference = verticalDatum.getReference();
reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vdpt::setActuate);
reference.getArcrole().ifPresent(vdpt::setArcrole);
reference.getHref().map(URI::toString).ifPresent(vdpt::setHref);
reference.getRole().ifPresent(vdpt::setRole);
reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vdpt::setShow);
reference.getTitle().ifPresent(vdpt::setTitle);
reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vdpt::setType);
} else {
if (verticalDatum.isInstance()) {
Nillable<VerticalDatum> nillable = verticalDatum.getInstance();
if (nillable.isPresent()) {
XmlObject xml = createVerticalDatum(nillable.get(), EncodingContext.empty());
if (xml != null && xml instanceof VerticalDatumType) {
vdpt.setVerticalDatum((VerticalDatumType) xml);
} else {
vdpt.setNil();
vdpt.setNilReason(Nillable.missing().get());
}
} else {
vdpt.setNil();
if (nillable.hasReason()) {
vdpt.setNilReason(nillable.getNilReason().get());
} else {
vdpt.setNilReason(Nillable.missing().get());
}
}
}
}
if (ctx.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
VerticalCRSPropertyType vcrspt = VerticalCRSPropertyType.Factory.newInstance();
vcrspt.setVerticalCRS(vcrst);
return vcrspt;
}
return vcrst;
}
Aggregations