The conversion between two Spatial Reference Systems
(SRS) is performed by a coordinate transformation, that is, a mathematical
transformation or a chain of mathematical transformations.
For example, when superimposing Global Positioning System
(GPS) points (expressed in longitude and latitude) on a state map
(where coordinates are expressed in meters, in
UTM projection), the GPS coordinates are expressed
in a geographic coordinate system, while the state map coordinates
are in a projected coordinate system. Once the SRS for each data source
is known, the
JViews Maps package is able to construct a mathematical
transformation to convert from one coordinate system to another.
SRS and coordinate transformations are mainly used for
two purposes.
The first one is to render the pipeline of the reader
framework, and the main steps are:
Defining the source SRS
The SRS of source data is often stored in the reader
or in the feature of the iterator that is used. If not, the reader
provides the setSourceCoordinateSystem()
method.
The SRS of source data is stored in map features returned by the iterator.
Defining the target SRS
The SRS of target data is optional. In fact, the rendering
mechanism only needs a coordinate transformation. Before rendering
your graphic objects, you have to create the coordinate transformation
once.
Creating the coordinate transformation
If no coordinate transformation is needed, the rendering
can be performed using an identity transformation.
Iterating on map features provided by
the iterator, and rendering them.
The second one is to position free data, (without the
renderers, you create the coordinate of the graphic object yourself),
and the main steps are nearly the same:
Defining the source SRS.
Defining the target SRS.
Creating the coordinate transformation.
Transforming each coordinate manually.
The following packages define some useful SRS to be used
with maps:
Contains coordinate systems
and related classes.
Defines the transformations
between coordinate systems.
-
Defines factories and utility classes to convert coordinate
systems to and from Open GIS Well-Known Text (WKT) specifications.
-
Defines projections used in projected coordinate systems.
Note
The projection
package also
contains the definition of ellipsoids and geodetic datum (horizontal
datum), even when these are not specific to projections and are used
by the coordsys
package. This is to keep
the compatibility with earlier JViews Maps versions prior to 5.0, where only
projected coordinate systems were handled through the use of projections.