aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-09-25 10:08:15 +0200
committerGitHub <noreply@github.com>2017-09-25 10:08:15 +0200
commit03750c1961d2978773ac0b4a0423b1cdcc2c6453 (patch)
tree95d3b3ca09850e8bcf99ef891a7da8a5abf68996
parent7db3acd2df38508e107209c912ac0b5ce2663f9c (diff)
parent6fb79f304faec4d036ea46f19aa197e8cc85fe2e (diff)
downloadPROJ-03750c1961d2978773ac0b4a0423b1cdcc2c6453.tar.gz
PROJ-03750c1961d2978773ac0b4a0423b1cdcc2c6453.zip
Merge pull request #570 from kbevers/api-streamlining
Streamlining the proj.h API
-rw-r--r--src/PJ_cart.c18
-rw-r--r--src/PJ_hgridshift.c6
-rw-r--r--src/PJ_horner.c10
-rw-r--r--src/PJ_molodensky.c4
-rw-r--r--src/PJ_pipeline.c6
-rw-r--r--src/PJ_unitconvert.c4
-rw-r--r--src/PJ_vgridshift.c8
-rw-r--r--src/pj_obs_api.c40
-rw-r--r--src/proj.h63
9 files changed, 75 insertions, 84 deletions
diff --git a/src/PJ_cart.c b/src/PJ_cart.c
index 257d0dca..d50036b5 100644
--- a/src/PJ_cart.c
+++ b/src/PJ_cart.c
@@ -253,7 +253,7 @@ int pj_cart_selftest (void) {
char buf[40];
/* An utm projection on the GRS80 ellipsoid */
- P = proj_create (0, arg);
+ P = proj_create (PJ_DEFAULT_CTX, arg);
if (0==P)
return 1;
@@ -262,7 +262,7 @@ int pj_cart_selftest (void) {
proj_destroy (P);
/* Same projection, now using argc/argv style initialization */
- P = proj_create_argv (0, 3, args);
+ P = proj_create_argv (PJ_DEFAULT_CTX, 3, args);
if (0==P)
return 2;
@@ -306,7 +306,7 @@ int pj_cart_selftest (void) {
proj_destroy (P);
/* Now do some 3D transformations */
- P = proj_create (0, "+proj=cart +ellps=GRS80");
+ P = proj_create (PJ_DEFAULT_CTX, "+proj=cart +ellps=GRS80");
if (0==P)
return 6;
@@ -374,7 +374,7 @@ int pj_cart_selftest (void) {
/* Testing the proj_transform nightmare */
/* An utm projection on the GRS80 ellipsoid */
- P = proj_create (0, "+proj=utm +zone=32 +ellps=GRS80");
+ P = proj_create (PJ_DEFAULT_CTX, "+proj=utm +zone=32 +ellps=GRS80");
if (0==P)
return 13;
@@ -457,7 +457,7 @@ int pj_cart_selftest (void) {
proj_destroy (P);
/* test proj_create_crs_to_crs() */
- P = proj_create_crs_to_crs(0, "epsg:25832", "epsg:25833");
+ P = proj_create_crs_to_crs(PJ_DEFAULT_CTX, "epsg:25832", "epsg:25833");
if (P==0)
return 50;
@@ -472,7 +472,7 @@ int pj_cart_selftest (void) {
proj_destroy(P);
/* let's make sure that only entries in init-files results in a usable PJ */
- P = proj_create_crs_to_crs(0, "proj=utm +zone=32 +datum=WGS84", "proj=utm +zone=33 +datum=WGS84");
+ P = proj_create_crs_to_crs(PJ_DEFAULT_CTX, "proj=utm +zone=32 +datum=WGS84", "proj=utm +zone=33 +datum=WGS84");
if (P != 0) {
proj_destroy(P);
return 52;
@@ -495,11 +495,11 @@ int pj_cart_selftest (void) {
if (info.searchpath[0] == '\0') return 57;
/* proj_pj_info() */
- P = proj_create(0, "+proj=august"); /* august has no inverse */
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=august"); /* august has no inverse */
if (proj_pj_info(P).has_inverse) { proj_destroy(P); return 60; }
proj_destroy(P);
- P = proj_create(0, arg);
+ P = proj_create(PJ_DEFAULT_CTX, arg);
pj_info = proj_pj_info(P);
if ( !pj_info.has_inverse ) { proj_destroy(P); return 61; }
if ( strcmp(pj_info.definition, arg) ) { proj_destroy(P); return 62; }
@@ -539,7 +539,7 @@ int pj_cart_selftest (void) {
/* test proj_derivatives_retrieve() and proj_factors_retrieve() */
- P = proj_create(0, "+proj=merc");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=merc");
a = proj_obs_null;
a.coo.lp.lam = PJ_TORAD(12);
a.coo.lp.phi = PJ_TORAD(55);
diff --git a/src/PJ_hgridshift.c b/src/PJ_hgridshift.c
index 674b4da8..4ee3fd42 100644
--- a/src/PJ_hgridshift.c
+++ b/src/PJ_hgridshift.c
@@ -110,18 +110,18 @@ int pj_hgridshift_selftest (void) {
double dist;
/* fail on purpose: +grids parameter is mandatory*/
- P = proj_create(0, "+proj=hgridshift");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=hgridshift");
if (0!=P)
return 99;
/* fail on purpose: open non-existing grid */
- P = proj_create(0, "+proj=hgridshift +grids=nonexistinggrid.gsb");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=hgridshift +grids=nonexistinggrid.gsb");
if (0!=P)
return 999;
/* Failure most likely means the grid is missing */
- P = proj_create (0, "+proj=hgridshift +grids=nzgd2kgrid0005.gsb +ellps=GRS80");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=hgridshift +grids=nzgd2kgrid0005.gsb +ellps=GRS80");
if (0==P)
return 10;
diff --git a/src/PJ_horner.c b/src/PJ_horner.c
index c6560d3a..a9a618c7 100644
--- a/src/PJ_horner.c
+++ b/src/PJ_horner.c
@@ -94,7 +94,7 @@ PROJ_HEAD(horner, "Horner polynomial evaluation");
struct horner;
typedef struct horner HORNER;
-static UV horner (const HORNER *transformation, enum proj_direction, UV position);
+static UV horner (const HORNER *transformation, PJ_DIRECTION direction, UV position);
static HORNER *horner_alloc (size_t order, int complex_polynomia);
static void horner_free (HORNER *h);
@@ -178,7 +178,7 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) {
/**********************************************************************/
-static UV horner (const HORNER *transformation, enum proj_direction direction, UV position) {
+static UV horner (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
/***********************************************************************
A reimplementation of the classic Engsager/Poder 2D Horner polynomial
@@ -303,7 +303,7 @@ static PJ_OBS horner_reverse_obs (PJ_OBS point, PJ *P) {
/**********************************************************************/
-static UV complex_horner (const HORNER *transformation, enum proj_direction direction, UV position) {
+static UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
/***********************************************************************
A reimplementation of a classic Engsager/Poder Horner complex
@@ -529,7 +529,7 @@ int pj_horner_selftest (void) {
double dist;
/* Real polynonia relating the technical coordinate system TC32 to "System 45 Bornholm" */
- P = proj_create (0, tc32_utm32);
+ P = proj_create (PJ_DEFAULT_CTX, tc32_utm32);
if (0==P)
return 10;
@@ -543,7 +543,7 @@ int pj_horner_selftest (void) {
return 1;
/* The complex polynomial transformation between the "System Storebaelt" and utm32/ed50 */
- P = proj_create (0, sb_utm32);
+ P = proj_create (PJ_DEFAULT_CTX, sb_utm32);
if (0==P)
return 11;
diff --git a/src/PJ_molodensky.c b/src/PJ_molodensky.c
index 49e27763..d9377234 100644
--- a/src/PJ_molodensky.c
+++ b/src/PJ_molodensky.c
@@ -338,7 +338,7 @@ int pj_molodensky_selftest (void) {
PJ *P;
/* Test the abridged Molodensky first. Example from appendix 3 of Deakin (2004). */
- P = proj_create(0,
+ P = proj_create(PJ_DEFAULT_CTX,
"+proj=molodensky +a=6378160 +rf=298.25 "
"+da=-23 +df=-8.120449e-8 +dx=-134 +dy=-48 +dz=149 "
"+abridged "
@@ -376,7 +376,7 @@ int pj_molodensky_selftest (void) {
/* Test the abridged Molodensky first. Example from appendix 3 of Deaking (2004). */
- P = proj_create(0,
+ P = proj_create(PJ_DEFAULT_CTX,
"+proj=molodensky +a=6378160 +rf=298.25 "
"+da=-23 +df=-8.120449e-8 +dx=-134 +dy=-48 +dz=149 "
);
diff --git a/src/PJ_pipeline.c b/src/PJ_pipeline.c
index 6e42c0cb..a26f3ccf 100644
--- a/src/PJ_pipeline.c
+++ b/src/PJ_pipeline.c
@@ -526,7 +526,7 @@ int pj_pipeline_selftest (void) {
double dist;
/* forward-reverse geo->utm->geo */
- P = proj_create (0, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 +step +proj=utm +ellps=GRS80 +inv");
+ P = proj_create (PJ_DEFAULT_CTX, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 +step +proj=utm +ellps=GRS80 +inv");
if (0==P)
return 1000;
/* zero initialize everything, then set (longitude, latitude, height) to (12, 55, 0) */
@@ -548,7 +548,7 @@ int pj_pipeline_selftest (void) {
proj_destroy (P);
/* And now the back-to-back situation utm->geo->utm */
- P = proj_create (0, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 +inv +step +proj=utm +ellps=GRS80");
+ P = proj_create (PJ_DEFAULT_CTX, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 +inv +step +proj=utm +ellps=GRS80");
if (0==P)
return 2000;
@@ -572,7 +572,7 @@ int pj_pipeline_selftest (void) {
/* Finally testing a corner case: A rather pointless one-step pipeline geo->utm */
- P = proj_create (0, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 ");
+ P = proj_create (PJ_DEFAULT_CTX, "+proj=pipeline +zone=32 +step +proj=utm +ellps=GRS80 ");
if (0==P)
return 3000;
diff --git a/src/PJ_unitconvert.c b/src/PJ_unitconvert.c
index 06723399..7ce6035c 100644
--- a/src/PJ_unitconvert.c
+++ b/src/PJ_unitconvert.c
@@ -412,7 +412,7 @@ int pj_unitconvert_selftest (void) {return 0;}
static int test_time(char* args, double tol, double t_in, double t_exp) {
PJ_OBS in, out;
- PJ *P = proj_create(0, args);
+ PJ *P = proj_create(PJ_DEFAULT_CTX, args);
int ret = 0;
if (P == 0)
@@ -438,7 +438,7 @@ static int test_time(char* args, double tol, double t_in, double t_exp) {
static int test_xyz(char* args, double tol, PJ_TRIPLET in, PJ_TRIPLET exp) {
PJ_OBS out, obs_in;
- PJ *P = proj_create(0, args);
+ PJ *P = proj_create(PJ_DEFAULT_CTX, args);
int ret = 0;
if (P == 0)
diff --git a/src/PJ_vgridshift.c b/src/PJ_vgridshift.c
index e790cd4d..0f031d4f 100644
--- a/src/PJ_vgridshift.c
+++ b/src/PJ_vgridshift.c
@@ -112,18 +112,18 @@ int pj_vgridshift_selftest (void) {
PJ_OBS expect, a, b;
double dist;
- /* fail on purpose: +grids parameter it mandatory*/
- P = proj_create(0, "+proj=vgridshift");
+ /* fail on purpose: +grids parameter is mandatory*/
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=vgridshift");
if (0!=P)
return 99;
/* fail on purpose: open non-existing grid */
- P = proj_create(0, "+proj=vgridshift +grids=nonexistinggrid.gtx");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=vgridshift +grids=nonexistinggrid.gtx");
if (0!=P)
return 999;
/* Failure most likely means the grid is missing */
- P = proj_create (0, "+proj=vgridshift +grids=egm96_15.gtx +ellps=GRS80");
+ P = proj_create(PJ_DEFAULT_CTX, "+proj=vgridshift +grids=egm96_15.gtx +ellps=GRS80");
if (0==P)
return 10;
diff --git a/src/pj_obs_api.c b/src/pj_obs_api.c
index b2929a07..5c9f398b 100644
--- a/src/pj_obs_api.c
+++ b/src/pj_obs_api.c
@@ -70,7 +70,7 @@ PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, dou
/* Geodesic distance between two points with angular 2D coordinates */
-double proj_lp_dist (PJ *P, LP a, LP b) {
+double proj_lp_dist (const PJ *P, LP a, LP b) {
double s12, azi1, azi2;
/* Note: the geodesic code takes arguments in degrees */
geod_inverse (P->geod, PJ_TODEG(a.phi), PJ_TODEG(a.lam), PJ_TODEG(b.phi), PJ_TODEG(b.lam), &s12, &azi1, &azi2);
@@ -90,7 +90,7 @@ double proj_xyz_dist (XYZ a, XYZ b) {
/* Measure numerical deviation after n roundtrips fwd-inv (or inv-fwd) */
-double proj_roundtrip (PJ *P, enum proj_direction direction, int n, PJ_OBS obs) {
+double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_OBS obs) {
int i;
PJ_OBS o, u;
@@ -125,7 +125,7 @@ double proj_roundtrip (PJ *P, enum proj_direction direction, int n, PJ_OBS obs)
/* Apply the transformation P to the coordinate coo */
-PJ_OBS proj_trans_obs (PJ *P, enum proj_direction direction, PJ_OBS obs) {
+PJ_OBS proj_trans_obs (PJ *P, PJ_DIRECTION direction, PJ_OBS obs) {
if (0==P)
return obs;
@@ -147,7 +147,7 @@ PJ_OBS proj_trans_obs (PJ *P, enum proj_direction direction, PJ_OBS obs) {
/* Apply the transformation P to the coordinate coo */
-PJ_COORD proj_trans_coord (PJ *P, enum proj_direction direction, PJ_COORD coo) {
+PJ_COORD proj_trans_coord (PJ *P, PJ_DIRECTION direction, PJ_COORD coo) {
if (0==P)
return coo;
@@ -171,7 +171,7 @@ PJ_COORD proj_trans_coord (PJ *P, enum proj_direction direction, PJ_COORD coo) {
/*************************************************************************************/
size_t proj_transform (
PJ *P,
- enum proj_direction direction,
+ PJ_DIRECTION direction,
double *x, size_t sx, size_t nx,
double *y, size_t sy, size_t ny,
double *z, size_t sz, size_t nz,
@@ -319,7 +319,7 @@ size_t proj_transform (
}
/*****************************************************************************/
-int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *obs) {
+int proj_transform_obs (PJ *P, PJ_DIRECTION direction, size_t n, PJ_OBS *obs) {
/******************************************************************************
Batch transform an array of PJ_OBS.
@@ -337,7 +337,7 @@ int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *
}
/*****************************************************************************/
-int proj_transform_coord (PJ *P, enum proj_direction direction, size_t n, PJ_COORD *coord) {
+int proj_transform_coord (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord) {
/******************************************************************************
Batch transform an array of PJ_COORD.
@@ -501,15 +501,16 @@ PJ_CONTEXT *proj_context_create (void) {
}
-void proj_context_destroy (PJ_CONTEXT *ctx) {
+PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx) {
if (0==ctx)
- return;
+ return 0;
/* Trying to free the default context is a no-op (since it is statically allocated) */
if (pj_get_default_ctx ()==ctx)
- return;
+ return 0;
pj_ctx_free (ctx);
+ return 0;
}
@@ -582,7 +583,7 @@ PJ_INFO proj_info(void) {
/*****************************************************************************/
-PJ_PROJ_INFO proj_pj_info(const PJ *P) {
+PJ_PROJ_INFO proj_pj_info(PJ *P) {
/******************************************************************************
Basic info about a particular instance of a projection object.
@@ -594,6 +595,11 @@ PJ_PROJ_INFO proj_pj_info(const PJ *P) {
memset(&info, 0, sizeof(PJ_PROJ_INFO));
+ /* Expected accuracy of the transformation. Hardcoded for now, will be improved */
+ /* later. Most likely to be used when a transformation is set up with */
+ /* proj_create_crs_to_crs in a future version that leverages the EPSG database. */
+ info.accuracy = -1.0;
+
if (!P) {
return info;
}
@@ -606,7 +612,7 @@ PJ_PROJ_INFO proj_pj_info(const PJ *P) {
pj_strlcpy(info.description, P->descr, sizeof(info.description));
/* projection definition */
- def = pj_get_def((PJ *)P, 0); /* pj_get_def takes a non-const PJ pointer */
+ def = pj_get_def(P, 0); /* pj_get_def takes a non-const PJ pointer */
pj_strlcpy(info.definition, &def[1], sizeof(info.definition)); /* def includes a leading space */
pj_dealloc(def);
@@ -729,7 +735,7 @@ PJ_INIT_INFO proj_init_info(const char *initname){
/*****************************************************************************/
-PJ_DERIVS proj_derivatives(const PJ *P, const LP lp) {
+PJ_DERIVS proj_derivatives(PJ *P, const LP lp) {
/******************************************************************************
Derivatives of coordinates.
@@ -739,8 +745,7 @@ PJ_DERIVS proj_derivatives(const PJ *P, const LP lp) {
******************************************************************************/
PJ_DERIVS derivs;
- /* casting to struct DERIVS for compatibility reasons */
- if (pj_deriv(lp, 1e-5, (PJ *)P, (struct DERIVS *)&derivs)) {
+ if (pj_deriv(lp, 1e-5, P, &derivs)) {
/* errno set in pj_derivs */
memset(&derivs, 0, sizeof(PJ_DERIVS));
}
@@ -750,7 +755,7 @@ PJ_DERIVS proj_derivatives(const PJ *P, const LP lp) {
/*****************************************************************************/
-PJ_FACTORS proj_factors(const PJ *P, const LP lp) {
+PJ_FACTORS proj_factors(PJ *P, const LP lp) {
/******************************************************************************
Cartographic characteristics at point lp.
@@ -766,8 +771,7 @@ PJ_FACTORS proj_factors(const PJ *P, const LP lp) {
/* pj_factors rely code being zero */
factors.code = 0;
- /* casting to struct FACTORS for compatibility reasons */
- if (pj_factors(lp, (PJ *)P, 0.0, (struct FACTORS *)&factors)) {
+ if (pj_factors(lp, P, 0.0, &factors)) {
/* errno set in pj_factors */
memset(&factors, 0, sizeof(PJ_FACTORS));
}
diff --git a/src/proj.h b/src/proj.h
index 3b4a1a67..600d5b30 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -182,11 +182,11 @@ typedef union PJ_TRIPLET PJ_TRIPLET;
union PJ_COORD;
typedef union PJ_COORD PJ_COORD;
-struct PJ_DERIVS;
-typedef struct PJ_DERIVS PJ_DERIVS;
+struct DERIVS;
+typedef struct DERIVS PJ_DERIVS;
-struct PJ_FACTORS;
-typedef struct PJ_FACTORS PJ_FACTORS;
+struct FACTORS;
+typedef struct FACTORS PJ_FACTORS;
/* Data type for projection/transformation information */
struct PJconsts;
@@ -288,22 +288,6 @@ struct PJ_OBS {
unsigned int flags; /* additional data, intended for flags */
};
-
-struct PJ_DERIVS {
- double x_l, x_p; /* derivatives of x for lambda-phi */
- double y_l, y_p; /* derivatives of y for lambda-phi */
-};
-
-struct PJ_FACTORS {
- struct PJ_DERIVS der;
- double h, k; /* meridional, parallel scales */
- double omega, thetap; /* angular distortion, theta prime */
- double conv; /* convergence */
- double s; /* areal scale factor */
- double a, b; /* max-min scale error */
- int code; /* info as to analytics, see following */
-};
-
#define PJ_IS_ANAL_XL_YL 01 /* derivatives of lon analytic */
#define PJ_IS_ANAL_XP_YP 02 /* derivatives of lat analytic */
#define PJ_IS_ANAL_HK 04 /* h and k analytic */
@@ -321,10 +305,11 @@ struct PJ_INFO {
};
struct PJ_PROJ_INFO {
- char id[16]; /* Name of the projection in question */
- char description[128]; /* Description of the projection */
- char definition[512]; /* Projection definition */
- int has_inverse; /* 1 if an inverse mapping exists, 0 otherwise */
+ char id[16]; /* Name of the projection in question */
+ char description[128]; /* Description of the projection */
+ char definition[512]; /* Projection definition */
+ int has_inverse; /* 1 if an inverse mapping exists, 0 otherwise */
+ double accuracy; /* Expected accuracy of the transformation. -1 if unknown. */
};
struct PJ_GRID_INFO {
@@ -355,8 +340,10 @@ typedef struct projCtx_t PJ_CONTEXT;
/* Functionality for handling thread contexts */
+#define PJ_DEFAULT_CTX 0
PJ_CONTEXT *proj_context_create (void);
-void proj_context_destroy (PJ_CONTEXT *ctx);
+PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx);
+
/* Manage the transformation definition object PJ */
@@ -367,38 +354,38 @@ PJ *proj_destroy (PJ *P);
/* Apply transformation to observation - in forward or inverse direction */
-enum proj_direction {
+enum PJ_DIRECTION {
PJ_FWD = 1, /* Forward */
PJ_IDENT = 0, /* Do nothing */
PJ_INV = -1 /* Inverse */
};
+typedef enum PJ_DIRECTION PJ_DIRECTION;
-
-PJ_OBS proj_trans_obs (PJ *P, enum proj_direction direction, PJ_OBS obs);
-PJ_COORD proj_trans_coord (PJ *P, enum proj_direction direction, PJ_COORD coord);
+PJ_OBS proj_trans_obs (PJ *P, PJ_DIRECTION direction, PJ_OBS obs);
+PJ_COORD proj_trans_coord (PJ *P, PJ_DIRECTION direction, PJ_COORD coord);
size_t proj_transform (
PJ *P,
- enum proj_direction direction,
+ PJ_DIRECTION direction,
double *x, size_t sx, size_t nx,
double *y, size_t sy, size_t ny,
double *z, size_t sz, size_t nz,
double *t, size_t st, size_t nt
);
-int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *obs);
-int proj_transform_coord (PJ *P, enum proj_direction direction, size_t n, PJ_COORD *coord);
+int proj_transform_obs (PJ *P, PJ_DIRECTION direction, size_t n, PJ_OBS *obs);
+int proj_transform_coord (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord);
/* Initializers */
PJ_COORD proj_coord (double x, double y, double z, double t);
PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags);
/* Measure internal consistency - in forward or inverse direction */
-double proj_roundtrip (PJ *P, enum proj_direction direction, int n, PJ_OBS obs);
+double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_OBS obs);
/* Geodesic distance between two points with angular 2D coordinates */
-double proj_lp_dist (PJ *P, LP a, LP b);
+double proj_lp_dist (const PJ *P, LP a, LP b);
/* Euclidean distance between two points with linear 2D coordinates */
double proj_xy_dist (XY a, XY b);
@@ -414,12 +401,12 @@ int proj_errno_reset (PJ *P);
void proj_errno_restore (PJ *P, int err);
-PJ_DERIVS proj_derivatives(const PJ *P, const LP lp);
-PJ_FACTORS proj_factors(const PJ *P, const LP lp);
-
+PJ_DERIVS proj_derivatives(PJ *P, const LP lp);
+PJ_FACTORS proj_factors(PJ *P, const LP lp);
+
/* Info functions - get information about various PROJ.4 entities */
PJ_INFO proj_info(void);
-PJ_PROJ_INFO proj_pj_info(const PJ *P);
+PJ_PROJ_INFO proj_pj_info(PJ *P);
PJ_GRID_INFO proj_grid_info(const char *gridname);
PJ_INIT_INFO proj_init_info(const char *initname);