The org.geotools.cs
, ct
and
pt
packages are basically org.opengis
mirrors.
Most classes have a 1 to 1 equivalent. However, the Geotools's API is
modified in order to make it more "Java friendly" and ease interoperability
with other Java packages (specially
Java2D and
Java Advanced Imaging).
The main differences are listed below:
The OpenGIS specification requires that every classes and
interfaces name begin with a two letters prefix (e.g. CS_
in org.opengis.cs.CS_CoordinateSystem
and CT_
in org.opengis.ct.CT_CoordinateTransformation
). Those prefix are
redundant with package name and are omitted in Geotools classes.
The OpenGIS's specification define enumeration classes,
but use them only for parameters and return values in method calls. Enumeration
constants are declared as integer. In the Geotools's API, all enumeration classes
are immutable. Enumeration constants are instances of the actual enumeration
class instead of integers. Names are uppercase, with no redundant prefix like
CT_TT
, CT_DF
or CS_AO
.
Geotools provides localization support. Methods
defined as getName()
by OpenGIS are redefined as
getName(Locale)
by Geotools.
The CoordinateTransformation
class is a subclass of Info
, since it redefine
the same methods.
Changed signature of various MathTransform.transform(...)
methods. Geotools signatures are similar to AffineTransform
's transform methods,
which should be familiar to many Java programmers. They offer better performance
for local use (as opposed to RMI use). Note that the OpenGIS's signatures
are better suited for RMI use.
Ellipsoid.getInverseFlattening()
returns
Double.POSITIVE_INFINITY
instead of 0 for perfect spheres.
Infinity is the mathematically correct value.
Some OpenGIS interfaces have been omitted in
order to avoid redundancies with standard Java classes or other
OpenGIS classes:
Omitted class or method | Replacement |
---|---|
CS_Unit and subclass |
org.geotools.units.Unit ,
a temporary placeholder for the upcomming javax.units
package from JSR-108. |
CT_Parameter[] andCS_ProjectionParameter[] |
javax.media.jai.ParameterList |