JPROJ4
|
Functions used by the Java Native Interface (JNI) wrappers of Proj.4. More...
Macros | |
#define | PJ_FIELD_NAME "ptr" |
#define | PJ_FIELD_TYPE "J" |
#define | PJ_MAX_DIMENSION 100 |
Functions | |
PJ * | getPJ (JNIEnv *env, jobject object) |
Internal method returning the address of the PJ structure wrapped by the given Java object. This function looks for a field named "ptr" and of type "long" (Java signature "J") in the given object. More... | |
jdouble | javaNaN (JNIEnv *env) |
Internal method returning the java.lang.Double.NaN constant value. Efficiency is no a high concern for this particular method, because it is used mostly when the user wrongly attempt to use a disposed PJ object. More... | |
JNIEXPORT jstring JNICALL | Java_org_proj4_PJ_getVersion (JNIEnv *env, jclass class) |
Returns the Proj4 release number. More... | |
JNIEXPORT jlong JNICALL | Java_org_proj4_PJ_allocatePJ (JNIEnv *env, jclass class, jstring definition) |
Allocates a new PJ structure from a definition string. More... | |
JNIEXPORT jlong JNICALL | Java_org_proj4_PJ_allocateGeoPJ (JNIEnv *env, jclass class, jobject projected) |
Allocates a new geographic PJ structure from an existing one. More... | |
JNIEXPORT jstring JNICALL | Java_org_proj4_PJ_getDefinition (JNIEnv *env, jobject object) |
Returns the definition string. More... | |
JNIEXPORT jstring JNICALL | Java_org_proj4_PJ_toString (JNIEnv *env, jobject object) |
Returns the description associated to the PJ structure. More... | |
JNIEXPORT jobject JNICALL | Java_org_proj4_PJ_getType (JNIEnv *env, jobject object) |
Returns the CRS type as one of the PJ.Type enum: GEOGRAPHIC, GEOCENTRIC or PROJECTED. This function should never return NULL, unless class or fields have been renamed in such a way that we can not find anymore the expected enum values. More... | |
JNIEXPORT jdouble JNICALL | Java_org_proj4_PJ_getSemiMajorAxis (JNIEnv *env, jobject object) |
Returns the semi-major axis length. More... | |
JNIEXPORT jdouble JNICALL | Java_org_proj4_PJ_getSemiMinorAxis (JNIEnv *env, jobject object) |
Computes the semi-minor axis length from the semi-major axis length and the eccentricity squared. More... | |
JNIEXPORT jdouble JNICALL | Java_org_proj4_PJ_getEccentricitySquared (JNIEnv *env, jobject object) |
Returns the eccentricity squared. More... | |
JNIEXPORT jcharArray JNICALL | Java_org_proj4_PJ_getAxisDirections (JNIEnv *env, jobject object) |
Returns an array of character indicating the direction of each axis. More... | |
JNIEXPORT jdouble JNICALL | Java_org_proj4_PJ_getGreenwichLongitude (JNIEnv *env, jobject object) |
Longitude of the prime meridian measured from the Greenwich meridian, positive eastward. More... | |
JNIEXPORT jdouble JNICALL | Java_org_proj4_PJ_getLinearUnitToMetre (JNIEnv *env, jobject object, jboolean vertical) |
Returns the conversion factor from linear units to metres. More... | |
void | convertAngularOrdinates (PJ *pj, double *data, jint numPts, int dimension, double factor) |
Converts input values from degrees to radians before coordinate operation, or the output values from radians to degrees after the coordinate operation. More... | |
JNIEXPORT void JNICALL | Java_org_proj4_PJ_transform (JNIEnv *env, jobject object, jobject target, jint dimension, jdoubleArray coordinates, jint offset, jint numPts) |
Transforms in-place the coordinates in the given array. More... | |
JNIEXPORT jstring JNICALL | Java_org_proj4_PJ_getLastError (JNIEnv *env, jobject object) |
Returns a description of the last error that occurred, or NULL if none. More... | |
JNIEXPORT void JNICALL | Java_org_proj4_PJ_finalize (JNIEnv *env, jobject object) |
Deallocate the PJ structure. This method is invoked by the garbage collector exactly once. This method will also set the Java "ptr" final field to 0 as a safety. In theory we are not supposed to change the value of a final field. But no Java code should use this field, and the PJ object is being garbage collected anyway. We set the field to 0 as a safety in case some user invoked the finalize() method explicitely despite our warning in the Javadoc to never do such thing. More... | |
#define PJ_FIELD_NAME "ptr" |
Referenced by getPJ(), and Java_org_proj4_PJ_finalize().
#define PJ_FIELD_TYPE "J" |
Referenced by getPJ(), and Java_org_proj4_PJ_finalize().
#define PJ_MAX_DIMENSION 100 |
Referenced by Java_org_proj4_PJ_transform().
PJ* getPJ | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References PJ_FIELD_NAME, and PJ_FIELD_TYPE.
Referenced by Java_org_proj4_PJ_allocateGeoPJ(), Java_org_proj4_PJ_getAxisDirections(), Java_org_proj4_PJ_getDefinition(), Java_org_proj4_PJ_getEccentricitySquared(), Java_org_proj4_PJ_getGreenwichLongitude(), Java_org_proj4_PJ_getLastError(), Java_org_proj4_PJ_getLinearUnitToMetre(), Java_org_proj4_PJ_getSemiMajorAxis(), Java_org_proj4_PJ_getSemiMinorAxis(), Java_org_proj4_PJ_getType(), Java_org_proj4_PJ_toString(), and Java_org_proj4_PJ_transform().
jdouble javaNaN | ( | JNIEnv * | env | ) |
env | - The JNI environment. |
References Java_org_proj4_PJ_getVersion().
Referenced by Java_org_proj4_PJ_getEccentricitySquared(), Java_org_proj4_PJ_getGreenwichLongitude(), Java_org_proj4_PJ_getLinearUnitToMetre(), Java_org_proj4_PJ_getSemiMajorAxis(), and Java_org_proj4_PJ_getSemiMinorAxis().
JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getVersion | ( | JNIEnv * | env, |
jclass | class | ||
) |
env | - The JNI environment. |
class | - The class from which this method has been invoked. |
References Java_org_proj4_PJ_allocatePJ().
Referenced by javaNaN().
JNIEXPORT jlong JNICALL Java_org_proj4_PJ_allocatePJ | ( | JNIEnv * | env, |
jclass | class, | ||
jstring | definition | ||
) |
env | - The JNI environment. |
class | - The class from which this method has been invoked. |
definition | - The string definition to be given to Proj4. |
References Java_org_proj4_PJ_allocateGeoPJ().
Referenced by Java_org_proj4_PJ_getVersion().
JNIEXPORT jlong JNICALL Java_org_proj4_PJ_allocateGeoPJ | ( | JNIEnv * | env, |
jclass | class, | ||
jobject | projected | ||
) |
env | - The JNI environment. |
class | - The class from which this method has been invoked. |
projected | - The PJ object from which to derive a new one. |
References getPJ(), and Java_org_proj4_PJ_getDefinition().
Referenced by Java_org_proj4_PJ_allocatePJ().
JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getDefinition | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), and Java_org_proj4_PJ_toString().
Referenced by Java_org_proj4_PJ_allocateGeoPJ().
JNIEXPORT jstring JNICALL Java_org_proj4_PJ_toString | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), and Java_org_proj4_PJ_getType().
Referenced by Java_org_proj4_PJ_getDefinition().
JNIEXPORT jobject JNICALL Java_org_proj4_PJ_getType | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), and Java_org_proj4_PJ_getSemiMajorAxis().
Referenced by Java_org_proj4_PJ_toString().
JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getSemiMajorAxis | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), Java_org_proj4_PJ_getSemiMinorAxis(), and javaNaN().
Referenced by Java_org_proj4_PJ_getType().
JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getSemiMinorAxis | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), Java_org_proj4_PJ_getEccentricitySquared(), and javaNaN().
Referenced by Java_org_proj4_PJ_getSemiMajorAxis().
JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getEccentricitySquared | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), Java_org_proj4_PJ_getAxisDirections(), and javaNaN().
Referenced by Java_org_proj4_PJ_getSemiMinorAxis().
JNIEXPORT jcharArray JNICALL Java_org_proj4_PJ_getAxisDirections | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), and Java_org_proj4_PJ_getGreenwichLongitude().
Referenced by Java_org_proj4_PJ_getEccentricitySquared().
JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getGreenwichLongitude | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), Java_org_proj4_PJ_getLinearUnitToMetre(), and javaNaN().
Referenced by Java_org_proj4_PJ_getAxisDirections().
JNIEXPORT jdouble JNICALL Java_org_proj4_PJ_getLinearUnitToMetre | ( | JNIEnv * | env, |
jobject | object, | ||
jboolean | vertical | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
vertical | - JNI_FALSE for horizontal axes, or JNI_TRUE for the vertical axis. |
References getPJ(), and javaNaN().
Referenced by Java_org_proj4_PJ_getGreenwichLongitude().
void convertAngularOrdinates | ( | PJ * | pj, |
double * | data, | ||
jint | numPts, | ||
int | dimension, | ||
double | factor | ||
) |
pj | - The Proj.4 PJ structure. |
data | - The coordinate array to transform. |
numPts | - Number of points to transform. |
dimension | - Dimension of points in the coordinate array. |
factor | - The scale factor to apply: M_PI/180 for inputs or 180/M_PI for outputs. |
References Java_org_proj4_PJ_transform().
Referenced by Java_org_proj4_PJ_transform().
JNIEXPORT void JNICALL Java_org_proj4_PJ_transform | ( | JNIEnv * | env, |
jobject | object, | ||
jobject | target, | ||
jint | dimension, | ||
jdoubleArray | coordinates, | ||
jint | offset, | ||
jint | numPts | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
target | - The target CRS. |
dimension | - The dimension of each coordinate value. Must be equals or greater than 2. |
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. |
References convertAngularOrdinates(), getPJ(), Java_org_proj4_PJ_getLastError(), and PJ_MAX_DIMENSION.
Referenced by convertAngularOrdinates().
JNIEXPORT jstring JNICALL Java_org_proj4_PJ_getLastError | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References getPJ(), and Java_org_proj4_PJ_finalize().
Referenced by Java_org_proj4_PJ_transform().
JNIEXPORT void JNICALL Java_org_proj4_PJ_finalize | ( | JNIEnv * | env, |
jobject | object | ||
) |
env | - The JNI environment. |
object | - The Java object wrapping the PJ structure (not allowed to be NULL). |
References PJ_FIELD_NAME, and PJ_FIELD_TYPE.
Referenced by Java_org_proj4_PJ_getLastError().