Skip to content

Revisit numerical types in metadata #46

@desruisseaux

Description

@desruisseaux

Interfaces in org.opengis.metadata packages use very specific types for numerical values, for example java.lang.Integer (fixed to 32 bits) or java.lang.Double (fixed to 64 bits). Those types are not always appropriate; an implementation may need to use a Long or even a BigInteger instead than 32 bits integers, or a BigDecimal instead than IEEE 754 floating point. We should leave that flexibility by using the more general Number type instead than a specific subtypes. In particular for the following properties:

  • MD_FeatureTypeInfo.featureInstanceCount: 32-bits integer type is insufficient.

For floating point values, many of them are actually measurements. For those ones, we should consider javax.measurement.Quantity.

Historical note: the decision to use specific subtypes was done in the GeoAPI 2 days for compatibility with technologies like JAXB or Hibernate. But even with this goal in mind, abstract types could have been used with the help of adapters.

Sub-issues

Metadata

Metadata

Assignees

Labels

JavaSpecific to the Java language or Java profile of GeoAPI

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions