Wraps the Proj4
More...
|
enum | Type |
| The coordinate reference system (CRS) type returned by PJ#getType().
|
|
native data structure. Almost every methods defined in this class are native methods delegating the work to the Proj.4 library. This class is the only place where such native methods are defined.
In the Proj.4 library, the
structure aggregates in a single place information usually splitted in many different ISO 19111 interfaces: org.opengis.referencing.datum.Ellipsoid, org.opengis.referencing.datum.Datum, org.opengis.referencing.datum.PrimeMeridian, org.opengis.referencing.cs.CoordinateSystem, org.opengis.referencing.crs.CoordinateReferenceSystem and their sub-interfaces. The relationship with the GeoAPI methods is indicated in the "See" tags when appropriate.
- Author
- Martin Desruisseaux (Geomatys)
PJ |
( |
final String |
definition | ) |
throws IllegalArgumentException |
structure from the given Proj4 definition string.
- Parameters
-
definition | The Proj.4 definition string. |
- Exceptions
-
IllegalArgumentException | If the PJ structure can not be created from the given string. |
PJ |
( |
final PJ |
crs, |
|
|
final Type |
type |
|
) |
| throws IllegalArgumentException |
structure derived from an existing
object. This constructor is usually for getting the org.opengis.referencing.crs.ProjectedCRS::getBaseCRS() base geographic CRS} from a org.opengis.referencing.crs.ProjectedCRS projected CRS}.
- Parameters
-
crs | The CRS (usually projected) from which to derive a new CRS. |
type | The type of the new CRS. Currently, only Type#GEOGRAPHIC is supported. |
- Exceptions
-
IllegalArgumentException | If the PJ structure can not be created. |
static native String getVersion |
( |
| ) |
|
|
static |
- Returns
- The Proj.4 release string.
native String getDefinition |
( |
| ) |
|
This is the string given to the constructor, expanded with as much information as possible.
- Returns
- The Proj4 definition string.
native double getSemiMajorAxis |
( |
| ) |
|
PJ field.
- Returns
- The axis length stored in .
- See also
- org.opengis.referencing.datum.Ellipsoid::getSemiMajorAxis()
native double getSemiMinorAxis |
( |
| ) |
|
√((a_orig)² × (1 - es_orig))
.
- Returns
- The axis length computed by
√((a_orig)² × (1 - es_orig))
.
- See also
- org.opengis.referencing.datum.Ellipsoid::getSemiMinorAxis()
native double getEccentricitySquared |
( |
| ) |
|
The eccentricity is related to axis length by ε=√(1-(b/a)²). The eccentricity of a sphere is zero.
- Returns
- The eccentricity.
- See also
- org.opengis.referencing.datum.Ellipsoid::isSphere()
-
org.opengis.referencing.datum.Ellipsoid::getInverseFlattening()
native char [] getAxisDirections |
( |
| ) |
|
Directions are characters like
for East,
for North and
for Up.
- Returns
- The axis directions.
- See also
- org.opengis.referencing.cs.CoordinateSystemAxis::getDirection()
native double getGreenwichLongitude |
( |
| ) |
|
- Returns
- The prime meridian longitude, in degrees.
- See also
- org.opengis.referencing.datum.PrimeMeridian::getGreenwichLongitude()
native double getLinearUnitToMetre |
( |
boolean |
vertical | ) |
|
- Parameters
-
vertical | code false for the conversion factor of horizontal axes, or for the conversion factor of the vertical axis. |
- Returns
- The conversion factor to metres for the given axis.
native void transform |
( |
PJ |
target, |
|
|
int |
dimension, |
|
|
double[] |
coordinates, |
|
|
int |
offset, |
|
|
int |
numPts |
|
) |
| throws PJException |
The coordinates array shall contain (x,y,z,…) tuples, where the z and following dimensions are optional. Note that any dimension after the z value are ignored.
Input and output units:
-
Angular units (as in longitude and latitudes) are decimal degrees.
-
Linear units are usually metres, but this is actually projection-dependent.
- Parameters
-
target | The target CRS. |
dimension | The dimension of each coordinate value. Must be in the [2-{ DIMENSION_MAX}] range. |
coordinates | The coordinates to transform, as a sequence of (x,y,<z>,…) tuples. |
offset | Offset of the first coordinate in the given array. |
numPts | Number of points to transform. |
- Exceptions
-
NullPointerException | If the or argument is null. |
IndexOutOfBoundsException | if the or arguments are invalid. |
PJException | If the operation failed for an other reason (provided by Proj4). |
- See also
- org.opengis.referencing.operation.MathTransform::transform(double[], int, double[], int, int)
native String getLastError |
( |
| ) |
|
if none.
- Returns
- The last error that occurred, or .
native String toString |
( |
| ) |
|
- Returns
- The string representation.
final native void finalize |
( |
| ) |
|
|
protected |
This method can be invoked only by the garbage collector, and must be invoked exactly once (no more, no less). NEVER INVOKE THIS METHOD EXPLICITELY, NEVER OVERRIDE.
final int DIMENSION_MAX = 100 |
|
static |
This upper limit is actually somewhat arbitrary. This limit exists mostly as a safety against potential misuse.