Search in sources :

Example 1 with AbstractDatumType

use of net.opengis.gml.x32.AbstractDatumType in project arctic-sea by 52North.

the class GmlEncoderv321 method addAbstractDatumValues.

private void addAbstractDatumValues(AbstractDatumType adt, AbstractDatum abstractDatum, EncodingContext ctx) throws EncodingException {
    addDefinitonValues(adt, abstractDatum);
    if (abstractDatum.hasAnchorDefinition()) {
        adt.setAnchorDefinition(createCodeType(abstractDatum.getAnchorDefinition()));
    }
    if (abstractDatum.hasDomainOfValidity()) {
        net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity dov = adt.addNewDomainOfValidity();
        Referenceable<DomainOfValidity> domainOfValidity = abstractDatum.getDomainOfValidity();
        if (domainOfValidity.isReference()) {
            Reference reference = domainOfValidity.getReference();
            reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(dov::setActuate);
            reference.getArcrole().ifPresent(dov::setArcrole);
            reference.getHref().map(URI::toString).ifPresent(dov::setHref);
            reference.getRole().ifPresent(dov::setRole);
            reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(dov::setShow);
            reference.getTitle().ifPresent(dov::setTitle);
            reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(dov::setType);
        } else {
            if (domainOfValidity.isInstance()) {
                Nillable<DomainOfValidity> nillable = domainOfValidity.getInstance();
                if (nillable.isPresent()) {
                    net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity xml = createDomainOfValidity(nillable.get(), EncodingContext.empty());
                    if (xml != null) {
                        dov.set(xml);
                    } else {
                        dov.setNil();
                        dov.setNilReason(Nillable.missing().get());
                    }
                } else {
                    dov.setNil();
                    if (nillable.hasReason()) {
                        dov.setNilReason(nillable.getNilReason().get());
                    } else {
                        dov.setNilReason(Nillable.missing().get());
                    }
                }
            }
        }
    }
    if (abstractDatum.hasRealizationEpoch()) {
        adt.setRealizationEpoch(abstractDatum.getRealizationEpoch().toCalendar(Locale.ROOT));
    }
    abstractDatum.getScope().forEach(scope -> adt.addNewScope().setStringValue(scope));
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) DomainOfValidity(org.n52.shetland.ogc.gml.DomainOfValidity) Reference(org.n52.shetland.w3c.xlink.Reference) Actuate(org.n52.shetland.w3c.xlink.Actuate) EnvelopeType(net.opengis.gml.x32.EnvelopeType) MultiPointType(net.opengis.gml.x32.MultiPointType) VerticalDatumPropertyType(net.opengis.gml.x32.VerticalDatumPropertyType) CodeType(net.opengis.gml.x32.CodeType) DirectPositionListType(net.opengis.gml.x32.DirectPositionListType) CoordinateSystemAxisPropertyType(net.opengis.gml.x32.CoordinateSystemAxisPropertyType) VerticalCSType(net.opengis.gml.x32.VerticalCSType) TimePeriodPropertyType(net.opengis.gml.x32.TimePeriodPropertyType) LineStringType(net.opengis.gml.x32.LineStringType) CoordinateSystemAxisType(net.opengis.gml.x32.CoordinateSystemAxisType) FeaturePropertyType(net.opengis.gml.x32.FeaturePropertyType) TimeInstantPropertyType(net.opengis.gml.x32.TimeInstantPropertyType) TimeIndeterminateValueType(net.opengis.gml.x32.TimeIndeterminateValueType) GeometryPropertyType(net.opengis.gml.x32.GeometryPropertyType) PolygonType(net.opengis.gml.x32.PolygonType) VerticalDatumType(net.opengis.gml.x32.VerticalDatumType) MultiCurveType(net.opengis.gml.x32.MultiCurveType) AggregationType(net.opengis.gml.x32.AggregationType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) ShowType(org.w3.x1999.xlink.ShowType) AbstractRingPropertyType(net.opengis.gml.x32.AbstractRingPropertyType) LinearRingType(net.opengis.gml.x32.LinearRingType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) TimePeriodType(net.opengis.gml.x32.TimePeriodType) ReferenceType(net.opengis.gml.x32.ReferenceType) TimeInstantType(net.opengis.gml.x32.TimeInstantType) GenericMetaDataType(net.opengis.gml.x32.GenericMetaDataType) ActuateType(org.w3.x1999.xlink.ActuateType) TimePositionType(net.opengis.gml.x32.TimePositionType) VerticalCRSType(net.opengis.gml.x32.VerticalCRSType) CurvePropertyType(net.opengis.gml.x32.CurvePropertyType) DefinitionType(net.opengis.gml.x32.DefinitionType) AbstractCoordinateSystemType(net.opengis.gml.x32.AbstractCoordinateSystemType) AbstractDatumType(net.opengis.gml.x32.AbstractDatumType) AbstractRingType(net.opengis.gml.x32.AbstractRingType) MeasureType(net.opengis.gml.x32.MeasureType) VerticalCSPropertyType(net.opengis.gml.x32.VerticalCSPropertyType) CodeWithAuthorityType(net.opengis.gml.x32.CodeWithAuthorityType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) AbstractGeometryType(net.opengis.gml.x32.AbstractGeometryType) DirectPositionType(net.opengis.gml.x32.DirectPositionType) FeatureCollectionType(net.opengis.gml.x32.FeatureCollectionType) PointType(net.opengis.gml.x32.PointType) VerticalCRSPropertyType(net.opengis.gml.x32.VerticalCRSPropertyType) Show(org.n52.shetland.w3c.xlink.Show) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Aggregations

AbstractCRSType (net.opengis.gml.x32.AbstractCRSType)1 AbstractCoordinateSystemType (net.opengis.gml.x32.AbstractCoordinateSystemType)1 AbstractDatumType (net.opengis.gml.x32.AbstractDatumType)1 AbstractGeometryType (net.opengis.gml.x32.AbstractGeometryType)1 AbstractRingPropertyType (net.opengis.gml.x32.AbstractRingPropertyType)1 AbstractRingType (net.opengis.gml.x32.AbstractRingType)1 AggregationType (net.opengis.gml.x32.AggregationType)1 CodeType (net.opengis.gml.x32.CodeType)1 CodeWithAuthorityType (net.opengis.gml.x32.CodeWithAuthorityType)1 CoordinateSystemAxisPropertyType (net.opengis.gml.x32.CoordinateSystemAxisPropertyType)1 CoordinateSystemAxisType (net.opengis.gml.x32.CoordinateSystemAxisType)1 CurvePropertyType (net.opengis.gml.x32.CurvePropertyType)1 DefinitionType (net.opengis.gml.x32.DefinitionType)1 DirectPositionListType (net.opengis.gml.x32.DirectPositionListType)1 DirectPositionType (net.opengis.gml.x32.DirectPositionType)1 EnvelopeType (net.opengis.gml.x32.EnvelopeType)1 FeatureCollectionType (net.opengis.gml.x32.FeatureCollectionType)1 FeaturePropertyType (net.opengis.gml.x32.FeaturePropertyType)1 GenericMetaDataType (net.opengis.gml.x32.GenericMetaDataType)1 GeometryPropertyType (net.opengis.gml.x32.GeometryPropertyType)1