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.
The ISO 19115-1 standard defines each attribute as optional, mandatory or conditional. The GeoAPI interfaces in the org.opengis.metadata packages reflects the ISO specification by allowing values to be null. Since Java primitive types such as int or double cannot be null, GeoAPI workarounds this limitation by using their wrapper classes instead, which are java.lang.Integer and java.lang.Double respectively. But those numeric values could have been made more flexible by using BigInteger and BigDecimal instead. It would avoid limitations in the magnitude of the number and in precision. It would also allows floating point values to better capture the precision intended by the data producer, which is usually in base 10 with a fixed number of fraction digits (that number can be specified to BigDecimal).. BigInteger and BigDecimal are the types used by default by some tools that generate Java code from XML schemas.
This proposal to replace java.lang.Integer and java.lang.Double by java.math.BigInteger and java.math.BigDecimal is for metadata only, because performance is usually not an issue in metadata (contrarily to referencing, features or coverages) and wrapper classes were already used in metadata anyway (we are not proposing to replace primitive type usages).
The ISO 19115-1 standard defines each attribute as optional, mandatory or conditional. The GeoAPI interfaces in the
org.opengis.metadata
packages reflects the ISO specification by allowing values to be null. Since Java primitive types such asint
ordouble
cannot be null, GeoAPI workarounds this limitation by using their wrapper classes instead, which arejava.lang.Integer
andjava.lang.Double
respectively. But those numeric values could have been made more flexible by usingBigInteger
andBigDecimal
instead. It would avoid limitations in the magnitude of the number and in precision. It would also allows floating point values to better capture the precision intended by the data producer, which is usually in base 10 with a fixed number of fraction digits (that number can be specified toBigDecimal
)..BigInteger
andBigDecimal
are the types used by default by some tools that generate Java code from XML schemas.This proposal to replace
java.lang.Integer
andjava.lang.Double
byjava.math.BigInteger
andjava.math.BigDecimal
is for metadata only, because performance is usually not an issue in metadata (contrarily to referencing, features or coverages) and wrapper classes were already used in metadata anyway (we are not proposing to replace primitive type usages).