Select Ellipsoidal versus Spherical Solution
--------------------------------------------

GMT will use ellipsoidal formulae if they are implemented and the
user have selected an ellipsoid as the reference shape (see
:term:`PROJ_ELLIPSOID`). The user needs to be aware of a
few potential pitfalls: (1) For some projections, such as Transverse
Mercator, Albers, and Lambert's conformal conic we use the ellipsoidal
expressions when the areas mapped are small, and switch to the spherical
expressions (and substituting the appropriate auxiliary latitudes) for
larger maps. The ellipsoidal formulae are used as follows: (a)
Transverse Mercator: When all points are within 10 degrees of central
meridian, (b) Conic projections when longitudinal range is less than 90
degrees, (c) Cassini projection when all points are within 4 degrees of
central meridian. (2) When you are trying to match some historical data
(e.g., coordinates obtained with a certain projection and a certain
reference ellipsoid) you may find that GMT gives results that are
slightly different. One likely source of this mismatch is that older
calculations often used less significant digits. For instance, Snyder's
examples often use the Clarke 1866 ellipsoid (defined by him as having a
flattening f = 1/294.98). From f we get the eccentricity squared to be
0.00676862818 (this is what GMT uses), while Snyder rounds off and
uses 0.00676866. This difference can give discrepancies of several tens
of cm. If you need to reproduce coordinates projected with this slightly
different eccentricity, you should specify your own ellipsoid with the
same parameters as Clarke 1866, but with f = 1/294.97861076. Also, be
aware that older data may be referenced to different datums, and unless
you know which datum was used and convert all data to a common datum you
may experience mismatches of tens to hundreds of meters. (3) Finally, be
aware that :term:`PROJ_SCALE_FACTOR` have certain default values for some
projections so you may have to override the setting in order to match
results produced with other settings. The decision of ellipsoidal
(if available) versus spherical is taken in this order:

    - The user specifies **-je** which forces the ellipsoidal solution.
    - The user specifies **-jg** which forces the spherical solution.
    - A specific region is set via **-R** which implies that portions
      of that region will be more than stated limit of longitude from
      the specific (or implied if not set) central meridian.

When a spherical solution is requested or implied, we consider the
currently selected ellipsoid and substitute the relevant auxiliary
latitude as latitude in the exact equation. Finally, coordinate
conversion may also be affected by the selected :term:`PROJ_SCALE_FACTOR`
which is typically 0.9996 but is 1 for a sphere.
**Note**: For some projection, a spherical solution may be used despite the user
having selected an ellipsoid. This occurs when the user's |-R| setting
implies a region that exceeds the domain in which the ellipsoidal series
expansions are valid. These are the conditions: (1) Lambert Conformal
Conic (**-JL**)and Albers Equal-Area (**-JB**) will use the spherical
solution when the map scale exceeds 1.0E7. (2) Transverse Mercator
(**-JT**) and UTM (**-JU**) will will use the spherical solution when
either the west or east boundary given in |-R| is more than 10 degrees
from the central meridian, and (3) same for Cassini
(**-JC**) but with a limit of only 4 degrees.
