Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit numerical types in metadata #46

Open
desruisseaux opened this issue Jun 11, 2019 · 0 comments
Open

Revisit numerical types in metadata #46

desruisseaux opened this issue Jun 11, 2019 · 0 comments
Assignees
Labels
Java Specific to the Java language.

Comments

@desruisseaux
Copy link
Contributor

desruisseaux commented Jun 11, 2019

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.

@desruisseaux desruisseaux added the Java Specific to the Java language. label Jun 23, 2019
@desruisseaux desruisseaux changed the title (Java profile) Revisit numerical types in metadata Revisit numerical types in metadata Jun 23, 2019
@desruisseaux desruisseaux self-assigned this Jun 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Specific to the Java language.
Projects
None yet
Development

No branches or pull requests

1 participant