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 37 forks source link

Standard TypeName and mapping to programming language #76

Closed desruisseaux closed 1 year ago

desruisseaux commented 1 year ago

ISO 19157 defines some properties like DQM_Measure.valueType of type TypeName (from ISO 19103) with the following documentation:

Shall be one of the data types defined by ISO/TS 19103:2005.

It would be convenient to have a consolidated list of main types, together with proposed mapping to Java or Python classes. A proposal is shown in the table below. This proposal uses an "OGC" namespace by consistency with data type URN standard value 1.1 in OGC schemas, which defines standard types like below:

By extension, proposal of standard TypeName values in GeoAPI:

Scoped type name Java class Python class
OGC:Boolean java.lang.Boolean int
OGC:Integer java.lang.Integer int
OGC:Real java.lang.Double float
OGC:Decimal java.math.BigDecimal float
OGC:CharacterString java.lang.String str
OGC:FreeText org.opengis.util.InternationalString str
OGC:PT_Locale java.util.Locale
OGC:DateTime java.time.ZonedDateTime
OGC:URI java.net.URI str
OGC:Matrix org.opengis.referencing.operation.Matrix np.ndarray
OGC:Coverage org.opengis.coverage.Coverage Coverage
OGC:MD_Metadata org.opengis.metadata.Metadata Metadata

An open question is how to manage collections. ISO 19157 has the following policy:

If we want to avoid ValueStructure in GeoAPI (see #74), where to put this information?