opengeospatial / geoapi

GeoAPI provides a set of interfaces in programming languages (currently Java and Python) for geospatial applications. The GeoAPI interfaces closely follow OGC specifications, adaptated to match the expectations of programmers.
http://www.geoapi.org
Apache License 2.0
118 stars 38 forks source link

Harmonize ISO 19157 parameter class #74

Closed desruisseaux closed 2 years ago

desruisseaux commented 2 years ago

ISO 19157 defines a DQM_Parameter class (added in #44), which duplicates the parameter classes provided by other standards:

GeoAPI tries to consolidate all parameters API in a single org.opengis.parameter package. If we apply this consolidation to ISO 19157 as well, then the SV_Parameter class should be omitted in favour of org.opengis.parameter.ParameterDescriptor (I didn't found the parameter value anywhere in ISO 19157). The mapping would be:

ISO 19157 ParameterDescriptor Change of value type
name getName() InternationalStringIdentifier
definition getName().getDescription()
description getDescription() DescriptionInternationalString
valueType getValueClass() RecordTypeClass<?>
valueStructure To be omitted?

The valueStructure attribute may be omitted because in an object-oriented language, we rather expect the valueType to be the structure, for example org.opengis.referencing.operation.Matrix.

desruisseaux commented 2 years ago

For the record, a Java interface derived verbatim from ISO 19157 would be like below (slightly simplified):

/**
 * Data quality parameter.
 *
 * @version 3.1
 * @since   3.1
 */
@UML(identifier="DQM_Parameter", specification=ISO_19157)
public interface Parameter {
    /**
     * Name of the data quality parameter.
     */
    @UML(identifier="name", obligation=MANDATORY, specification=ISO_19157)
    InternationalString getName();

    /**
     * Definition of the data quality parameter.
     */
    @UML(identifier="definition", obligation=MANDATORY, specification=ISO_19157)
    InternationalString getDefinition();

    /**
     * Description of the data quality parameter.
     */
    @UML(identifier="description", obligation=OPTIONAL, specification=ISO_19157)
    Description getDescription();

    /**
     * Value type of the data quality parameter.
     */
    @UML(identifier="valueType", obligation=MANDATORY, specification=ISO_19157)
    TypeName getValueType();

    /**
     * Structure of the data quality parameter.
     */
    @UML(identifier="valueStructure", obligation=OPTIONAL, specification=ISO_19157)
    ValueStructure getValueStructure();
}
desruisseaux commented 2 years ago

We still have an open issue about DQM_Description. In current version, the extendedDescription property (a BrowseGraphic) is lost. This is tracked in separated issue #78.

Regarding whether to omit ValueStructure, current version keeps it despite the fact that it now appears at only one location. If we omitted that property, it would have to be replaced by some method returning a Class<?>. So it would not really simplify the Measure interface. Keeping ValueStructure does the same functionality in a more controlled way (the set of valid types is more explicit).