Overview of ellipsoids
Ellipsoids are used to represent the shape
of the Earth. For many applications, and especially in
small-scale mapping (typically world maps), the Earth can be
represented as a sphere.
Most of the projections supplied in the ilog.views.maps.projection package assume
by default that the Earth is a sphere with a radius of
approximately 6371 kilometers. However, because the Earth rotates
on its axis, it is slightly flattened at the poles, and is
therefore better approximated by an ellipsoid rotating on the
polar axis. Ellipsoidal projections are used for accurate,
large-scale maps and flat coordinate
systems. However, in very large scale maps, representing a
continent or the whole planet, it is recommended that you use
spherical projections. Indeed, the elliptical form of most of the
projections in the projection package is accurate only for a few
degrees of latitude or longitude around the projection center.
Defining new ellipsoids
Ellipsoids can be described by many parameters. The ellipsoids
provided in the JViews
Maps package are defined by two parameters:
- The equatorial radius or semi-major axis (a) of the ellipsoid.
- The eccentricity squared of the ellipsoid.If the eccentricity squared is
null
, the ellipsoid is a sphere.
Defining a spherical ellipsoid
If only one parameter is provided, the
ellipsoid is assumed to be a sphere. The following example
defines a sphere with a radius of 6 000 kilometers (6000000
meters).
IlvEllipsoid ellipsoid = new IlvEllipsoid(6000000D);
Most of the mapping applications use the ellipsoid
IlvEllipsoid.SPHERE
that defines a sphere having dimensions very close to those of
the Earth. Generally, the selected ellipsoid should be as close
as possible to the actual shape of the Earth as far as the region
to be represented is concerned. The radius of the sphere is
expressed in meters.
The following example defines an ellipsoid
with an equatorial radius of 6000 kilometers and an eccentricity
squared of 0.0067:
IlvEllipsoid ellipsoid = new IlvEllipsoid(6000000D,0.0067D);
If you prefer to provide some other parameter than the
eccentricity squared, you can use the conversion methods provided
by the IlvEllipsoid class.
The following example defines an ellipsoid
with an equatorial radius of 6000 kilometers and a polar radius
of 5900 kilometers:
IlvEllipsoid ellipsoid = new IlvEllipsoid(6000000D, IlvEllipsoid.ESFromPolarRadius(6000000D, 5900000D));
The polar radius is converted to an eccentricity squared value
with the
ESFromPolarRadius()
method.
The class
IlvEllipsoid
provides the following conversion methods for polar radius and
flattening:
Predefined ellipsoids
The IlvEllipsoidCollection class manages lists
of predefined ellipsoids. A list of predefined ellipsoids, or kernel collection, can be retrieved using
the method GetKernelCollection.
Ellipsoid collections are read from XML
files containing the ellipsoid definitions. The Document Type
Definition (DTD) for these definition files is as follows:
<!DOCTYPE ellipsoid-list [ <!ELEMENT ellipsoid EMPTY> <!ATTLIST ellipsoid a CDATA #IMPLIED b CDATA #IMPLIED invf CDATA #IMPLIED name CDATA #REQUIRED comment CDATA #IMPLIED > <!ELEMENT ellipsoid-ref EMPTY> <!ATTLIST ellipsoid-ref ref CDATA #REQUIRED id CDATA #REQUIRED > <!ELEMENT ellipsoid-list (ellipsoid|ellipsoid-ref)* > ]>
In an ellipsoid definition file, you can
find:
- An ellipsoidDefined either by its name, or by its semi-major axis
a
and inverse flatteninginvf
, or its semi-major axisa
and semi-minor axisb
. - An alias for an ellipsoidDefined in the kernel collection of Maps. For an alias, the required information is the
id
of the ellipsoid (the name used to retrieve the ellipsoid) and the name of the ellipsoid in the kernel. When retrieving an ellipsoid alias from a collection, the ellipsoid is searched for using itsid
as a key, while the name of the returned ellipsoid is the one defined in the kernel collection.
The following XML file defines the Clarke
1880 ellipsoid, modified for IGN. This ellipsoid will be
available as “Clarke 1880 (IGN)”. Then you must set “WGS 1984” as
an alias for the kernel “WGS 84” ellipsoid:
<ellipsoid-list> <ellipsoid name="Clarke 1880 (IGN)" comment="Clarke 1880 (Modified for IGN)" a="6378249.2" invf="293.4660213" /> <ellipsoid-ref id="WGS 1984" ref="WGS84" /> </ellipsoid-list>