aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2018-12-31 11:37:51 +0100
committerGitHub <noreply@github.com>2018-12-31 11:37:51 +0100
commit32f3ef47e55c38b0eabb6d781fee3944d3239414 (patch)
treeba2850500ee732559bada055dbab281ceff49a22 /src
parent5c41d3a1078895ed096b416db15c91108bccad87 (diff)
parent0e0e0e475414ddeb75e0e140d8a3381a431036d9 (diff)
downloadPROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.tar.gz
PROJ-32f3ef47e55c38b0eabb6d781fee3944d3239414.zip
Merge pull request #1208 from rouault/merge_PJ_and_PJ_OBJ
Unify PJ_OBJ and PJ structures
Diffstat (limited to 'src')
-rw-r--r--src/4D_api.cpp81
-rw-r--r--src/Makefile.am2
-rw-r--r--src/aasincos.cpp3
-rw-r--r--src/adjlon.cpp4
-rw-r--r--src/apply_gridshift.cpp15
-rw-r--r--src/apply_vgridshift.cpp8
-rw-r--r--src/apps/cct.cpp2
-rw-r--r--src/apps/cs2cs.cpp70
-rw-r--r--src/apps/gen_cheb.cpp9
-rw-r--r--src/apps/geod.cpp2
-rw-r--r--src/apps/geod_interface.cpp3
-rw-r--r--src/apps/geod_set.cpp2
-rw-r--r--src/apps/gie.cpp2
-rw-r--r--src/apps/nad2bin.cpp4
-rw-r--r--src/apps/p_series.cpp3
-rw-r--r--src/apps/proj.cpp24
-rw-r--r--src/apps/projinfo.cpp3
-rw-r--r--src/auth.cpp3
-rw-r--r--src/bch2bps.cpp42
-rw-r--r--src/bchgen.cpp11
-rw-r--r--src/biveval.cpp23
-rw-r--r--src/conversions/axisswap.cpp11
-rw-r--r--src/conversions/cart.cpp14
-rw-r--r--src/conversions/geoc.cpp2
-rw-r--r--src/conversions/geocent.cpp12
-rw-r--r--src/conversions/unitconvert.cpp10
-rw-r--r--src/ctx.cpp2
-rw-r--r--src/datum_set.cpp3
-rw-r--r--src/datums.cpp2
-rw-r--r--src/deriv.cpp7
-rw-r--r--src/dmstor.cpp3
-rw-r--r--src/ell_set.cpp52
-rw-r--r--src/ellps.cpp2
-rw-r--r--src/errno.cpp3
-rw-r--r--src/factors.cpp4
-rw-r--r--src/fileapi.cpp3
-rw-r--r--src/fwd.cpp6
-rw-r--r--src/gauss.cpp11
-rw-r--r--src/gc_reader.cpp3
-rw-r--r--src/gridcatalog.cpp7
-rw-r--r--src/gridinfo.cpp16
-rw-r--r--src/gridlist.cpp3
-rw-r--r--src/init.cpp12
-rw-r--r--src/initcache.cpp3
-rw-r--r--src/internal.cpp2
-rw-r--r--src/inv.cpp6
-rw-r--r--src/iso19111/c_api.cpp1625
-rw-r--r--src/iso19111/coordinateoperation.cpp6
-rw-r--r--src/iso19111/datum.cpp2
-rw-r--r--src/iso19111/factory.cpp3
-rw-r--r--src/iso19111/io.cpp2
-rw-r--r--src/jniproj.cpp2
-rw-r--r--src/lib_proj.cmake2
-rw-r--r--src/list.cpp2
-rw-r--r--src/log.cpp2
-rw-r--r--src/malloc.cpp17
-rw-r--r--src/mk_cheby.cpp15
-rw-r--r--src/mlfn.cpp3
-rw-r--r--src/msfn.cpp3
-rw-r--r--src/mutex.cpp3
-rw-r--r--src/nad_cvt.cpp7
-rw-r--r--src/nad_init.cpp19
-rw-r--r--src/nad_intr.cpp8
-rw-r--r--src/open_lib.cpp2
-rw-r--r--src/param.cpp3
-rw-r--r--src/phi2.cpp3
-rw-r--r--src/pipeline.cpp18
-rw-r--r--src/pr_list.cpp3
-rw-r--r--src/proj.h219
-rw-r--r--src/proj_api.h9
-rw-r--r--src/proj_experimental.h229
-rw-r--r--src/proj_internal.h792
-rw-r--r--src/proj_mdist.cpp3
-rw-r--r--src/projections/aea.cpp10
-rw-r--r--src/projections/aeqd.cpp26
-rw-r--r--src/projections/airy.cpp6
-rw-r--r--src/projections/aitoff.cpp10
-rw-r--r--src/projections/august.cpp7
-rw-r--r--src/projections/bacon.cpp7
-rw-r--r--src/projections/bertin1953.cpp6
-rw-r--r--src/projections/bipc.cpp10
-rw-r--r--src/projections/boggs.cpp7
-rw-r--r--src/projections/bonne.cpp18
-rw-r--r--src/projections/calcofi.cpp18
-rw-r--r--src/projections/cass.cpp19
-rw-r--r--src/projections/cc.cpp10
-rw-r--r--src/projections/ccon.cpp10
-rw-r--r--src/projections/cea.cpp18
-rw-r--r--src/projections/chamb.cpp10
-rw-r--r--src/projections/collg.cpp10
-rw-r--r--src/projections/comill.cpp11
-rw-r--r--src/projections/crast.cpp11
-rw-r--r--src/projections/denoy.cpp7
-rw-r--r--src/projections/eck1.cpp11
-rw-r--r--src/projections/eck2.cpp10
-rw-r--r--src/projections/eck3.cpp11
-rw-r--r--src/projections/eck4.cpp11
-rw-r--r--src/projections/eck5.cpp11
-rw-r--r--src/projections/eqc.cpp10
-rw-r--r--src/projections/eqdc.cpp10
-rw-r--r--src/projections/eqearth.cpp11
-rw-r--r--src/projections/etmerc.cpp10
-rw-r--r--src/projections/fahey.cpp11
-rw-r--r--src/projections/fouc_s.cpp10
-rw-r--r--src/projections/gall.cpp11
-rw-r--r--src/projections/geos.cpp18
-rw-r--r--src/projections/gins8.cpp8
-rw-r--r--src/projections/gn_sinu.cpp18
-rw-r--r--src/projections/gnom.cpp10
-rw-r--r--src/projections/goode.cpp10
-rw-r--r--src/projections/gstmerc.cpp11
-rw-r--r--src/projections/hammer.cpp10
-rw-r--r--src/projections/hatano.cpp10
-rw-r--r--src/projections/healpix.cpp76
-rw-r--r--src/projections/igh.cpp15
-rw-r--r--src/projections/imw_p.cpp16
-rw-r--r--src/projections/isea.cpp6
-rw-r--r--src/projections/krovak.cpp11
-rw-r--r--src/projections/labrd.cpp11
-rw-r--r--src/projections/laea.cpp18
-rw-r--r--src/projections/lagrng.cpp10
-rw-r--r--src/projections/larr.cpp7
-rw-r--r--src/projections/lask.cpp8
-rw-r--r--src/projections/latlong.cpp18
-rw-r--r--src/projections/lcc.cpp10
-rw-r--r--src/projections/lcca.cpp10
-rw-r--r--src/projections/loxim.cpp10
-rw-r--r--src/projections/lsat.cpp10
-rw-r--r--src/projections/mbt_fps.cpp11
-rw-r--r--src/projections/mbtfpp.cpp10
-rw-r--r--src/projections/mbtfpq.cpp10
-rw-r--r--src/projections/merc.cpp18
-rw-r--r--src/projections/mill.cpp11
-rw-r--r--src/projections/misrsom.cpp10
-rw-r--r--src/projections/mod_ster.cpp11
-rw-r--r--src/projections/moll.cpp11
-rw-r--r--src/projections/natearth.cpp11
-rw-r--r--src/projections/natearth2.cpp11
-rw-r--r--src/projections/nell.cpp11
-rw-r--r--src/projections/nell_h.cpp11
-rw-r--r--src/projections/nicol.cpp7
-rw-r--r--src/projections/nsper.cpp10
-rw-r--r--src/projections/nzmg.cpp11
-rw-r--r--src/projections/ob_tran.cpp14
-rw-r--r--src/projections/ocea.cpp11
-rw-r--r--src/projections/oea.cpp10
-rw-r--r--src/projections/omerc.cpp10
-rw-r--r--src/projections/ortho.cpp12
-rw-r--r--src/projections/patterson.cpp11
-rw-r--r--src/projections/poly.cpp18
-rw-r--r--src/projections/putp2.cpp11
-rw-r--r--src/projections/putp3.cpp12
-rw-r--r--src/projections/putp4p.cpp11
-rw-r--r--src/projections/putp5.cpp11
-rw-r--r--src/projections/putp6.cpp11
-rw-r--r--src/projections/qsc.cpp11
-rw-r--r--src/projections/robin.cpp10
-rw-r--r--src/projections/rouss.cpp10
-rw-r--r--src/projections/rpoly.cpp7
-rw-r--r--src/projections/sch.cpp10
-rw-r--r--src/projections/sconics.cpp10
-rw-r--r--src/projections/somerc.cpp10
-rw-r--r--src/projections/stere.cpp18
-rw-r--r--src/projections/sterea.cpp11
-rw-r--r--src/projections/sts.cpp11
-rw-r--r--src/projections/tcc.cpp6
-rw-r--r--src/projections/tcea.cpp11
-rw-r--r--src/projections/times.cpp11
-rw-r--r--src/projections/tmerc.cpp18
-rw-r--r--src/projections/tobmerc.cpp10
-rw-r--r--src/projections/tpeqd.cpp10
-rw-r--r--src/projections/urm5.cpp6
-rw-r--r--src/projections/urmfps.cpp10
-rw-r--r--src/projections/vandg.cpp10
-rw-r--r--src/projections/vandg2.cpp7
-rw-r--r--src/projections/vandg4.cpp7
-rw-r--r--src/projections/wag2.cpp11
-rw-r--r--src/projections/wag3.cpp11
-rw-r--r--src/projections/wag7.cpp7
-rw-r--r--src/projections/wink1.cpp11
-rw-r--r--src/projections/wink2.cpp7
-rw-r--r--src/projects.h845
-rw-r--r--src/qsfn.cpp3
-rw-r--r--src/release.cpp2
-rw-r--r--src/rtodms.cpp3
-rw-r--r--src/strerrno.cpp2
-rw-r--r--src/strtod.cpp3
-rw-r--r--src/transform.cpp18
-rw-r--r--src/transformations/affine.cpp10
-rw-r--r--src/transformations/deformation.cpp22
-rw-r--r--src/transformations/helmert.cpp22
-rw-r--r--src/transformations/hgridshift.cpp6
-rw-r--r--src/transformations/horner.cpp21
-rw-r--r--src/transformations/molodensky.cpp20
-rw-r--r--src/transformations/vgridshift.cpp6
-rw-r--r--src/tsfn.cpp3
-rw-r--r--src/units.cpp2
-rw-r--r--src/utils.cpp3
-rw-r--r--src/vector1.cpp3
-rw-r--r--src/zpoly1.cpp3
200 files changed, 2927 insertions, 2843 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index 71144a75..d8288af8 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -39,9 +39,12 @@
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geodesic.h"
+#include "proj/common.hpp"
+#include "proj/coordinateoperation.hpp"
+
/* Initialize PJ_COORD struct */
PJ_COORD proj_coord (double x, double y, double z, double t) {
@@ -83,6 +86,9 @@ int proj_angular_output (PJ *P, enum PJ_DIRECTION dir) {
/* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */
PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b) {
PJ_COORD c;
+ if( !P->geod ) {
+ return proj_coord_error();
+ }
/* Note: the geodesic code takes arguments in degrees */
geod_inverse (P->geod,
PJ_TODEG(a.lpz.phi), PJ_TODEG(a.lpz.lam),
@@ -98,6 +104,9 @@ PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b) {
double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b) {
double s12, azi1, azi2;
/* Note: the geodesic code takes arguments in degrees */
+ if( !P->geod ) {
+ return HUGE_VAL;
+ }
geod_inverse (P->geod,
PJ_TODEG(a.lpz.phi), PJ_TODEG(a.lpz.lam),
PJ_TODEG(b.lpz.phi), PJ_TODEG(b.lpz.lam),
@@ -734,7 +743,7 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
- a PROJ string, like "+proj=longlat +datum=WGS84".
When using that syntax, the axis order and unit for geographic CRS will
be longitude, latitude, and the unit degrees.
- - more generally any string accepted by proj_obj_create_from_user_input()
+ - more generally any string accepted by proj_create_from_user_input()
An "area of use" can be specified in area. When it is supplied, the more
accurate transformation between two given systems can be chosen.
@@ -744,12 +753,6 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
PJ *P = proj_create_crs_to_crs(0, "EPSG:25832", "EPSG:25833", NULL);
******************************************************************************/
- PJ *P;
- PJ_OBJ* src;
- PJ_OBJ* dst;
- PJ_OPERATION_FACTORY_CONTEXT* operation_ctx;
- PJ_OBJ_LIST* op_list;
- PJ_OBJ* op;
const char* proj_string;
const char* const optionsProj4Mode[] = { "USE_PROJ4_INIT_RULES=YES", nullptr };
@@ -760,23 +763,23 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
const char* const* optionsImportCRS =
proj_context_get_use_proj4_init_rules(ctx, FALSE) ? optionsProj4Mode : nullptr;
- src = proj_obj_create_from_user_input(ctx, source_crs, optionsImportCRS);
+ auto src = proj_create_from_user_input(ctx, source_crs, optionsImportCRS);
if( !src ) {
proj_context_log_debug(ctx, "Cannot instanciate source_crs");
return nullptr;
}
- dst = proj_obj_create_from_user_input(ctx, target_crs, optionsImportCRS);
+ auto dst = proj_create_from_user_input(ctx, target_crs, optionsImportCRS);
if( !dst ) {
proj_context_log_debug(ctx, "Cannot instanciate target_crs");
- proj_obj_destroy(src);
+ proj_destroy(src);
return nullptr;
}
- operation_ctx = proj_create_operation_factory_context(ctx, nullptr);
+ auto operation_ctx = proj_create_operation_factory_context(ctx, nullptr);
if( !operation_ctx ) {
- proj_obj_destroy(src);
- proj_obj_destroy(dst);
+ proj_destroy(src);
+ proj_destroy(dst);
return nullptr;
}
@@ -793,35 +796,36 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
proj_operation_factory_context_set_grid_availability_use(
ctx, operation_ctx, PROJ_GRID_AVAILABILITY_DISCARD_OPERATION_IF_MISSING_GRID);
- op_list = proj_obj_create_operations(ctx, src, dst, operation_ctx);
+ auto op_list = proj_create_operations(ctx, src, dst, operation_ctx);
proj_operation_factory_context_destroy(operation_ctx);
- proj_obj_destroy(src);
- proj_obj_destroy(dst);
+ proj_destroy(src);
+ proj_destroy(dst);
if( !op_list ) {
return nullptr;
}
- if( proj_obj_list_get_count(op_list) == 0 ) {
- proj_obj_list_destroy(op_list);
+ if( proj_list_get_count(op_list) == 0 ) {
+ proj_list_destroy(op_list);
proj_context_log_debug(ctx, "No operation found matching criteria");
return nullptr;
}
- op = proj_obj_list_get(ctx, op_list, 0);
- proj_obj_list_destroy(op_list);
+ auto op = proj_list_get(ctx, op_list, 0);
+ proj_list_destroy(op_list);
if( !op ) {
return nullptr;
}
- proj_string = proj_obj_as_proj_string(ctx, op, PJ_PROJ_5, nullptr);
+ proj_string = proj_as_proj_string(ctx, op, PJ_PROJ_5, nullptr);
if( !proj_string) {
- proj_obj_destroy(op);
+ proj_destroy(op);
proj_context_log_debug(ctx, "Cannot export operation as a PROJ string");
return nullptr;
}
+ PJ* P;
if( proj_string[0] == '\0' ) {
/* Null transform ? */
P = proj_create(ctx, "proj=affine");
@@ -829,7 +833,7 @@ PJ *proj_create_crs_to_crs (PJ_CONTEXT *ctx, const char *source_crs, const char
P = proj_create(ctx, proj_string);
}
- proj_obj_destroy(op);
+ proj_destroy(op);
return P;
}
@@ -1069,9 +1073,6 @@ PJ_PROJ_INFO proj_pj_info(PJ *P) {
memset(&pjinfo, 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. */
pjinfo.accuracy = -1.0;
if (nullptr==P)
@@ -1081,8 +1082,30 @@ PJ_PROJ_INFO proj_pj_info(PJ *P) {
if (pj_param(P->ctx, P->params, "tproj").i)
pjinfo.id = pj_param(P->ctx, P->params, "sproj").s;
- /* projection description */
- pjinfo.description = P->descr;
+ /* coordinate operation description */
+ if( P->iso_obj ) {
+ pjinfo.description = P->iso_obj->nameStr().c_str();
+ } else {
+ pjinfo.description = P->descr;
+ }
+
+ // accuracy
+ if( P->iso_obj ) {
+ auto conv = dynamic_cast<const NS_PROJ::operation::Conversion*>(P->iso_obj.get());
+ if( conv ) {
+ pjinfo.accuracy = 0.0;
+ } else {
+ auto op = dynamic_cast<const NS_PROJ::operation::CoordinateOperation*>(P->iso_obj.get());
+ if( op ) {
+ const auto& accuracies = op->coordinateOperationAccuracies();
+ if( !accuracies.empty() ) {
+ try {
+ pjinfo.accuracy = std::stod(accuracies[0]->value());
+ } catch ( const std::exception& ) {}
+ }
+ }
+ }
+ }
/* projection definition */
if (P->def_full)
diff --git a/src/Makefile.am b/src/Makefile.am
index e8b9977c..3b23a044 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,7 @@ libproj_la_LDFLAGS = -no-undefined -version-info 14:1:1
libproj_la_LIBADD = @SQLITE3_LDFLAGS@
libproj_la_SOURCES = \
- pj_list.h proj_internal.h proj_math.h projects.h \
+ pj_list.h proj_internal.h proj_math.h \
\
iso19111/static.cpp \
iso19111/util.cpp \
diff --git a/src/aasincos.cpp b/src/aasincos.cpp
index 4f9ea25f..398a8cfc 100644
--- a/src/aasincos.cpp
+++ b/src/aasincos.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#define ONE_TOL 1.00000000000001
#define ATOL 1e-50
diff --git a/src/adjlon.cpp b/src/adjlon.cpp
index 784a90aa..112a9152 100644
--- a/src/adjlon.cpp
+++ b/src/adjlon.cpp
@@ -1,6 +1,8 @@
/* reduce argument to range +/- PI */
#include <math.h>
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
double adjlon (double lon) {
/* Let lon slightly overshoot, to avoid spurious sign switching at the date line */
diff --git a/src/apply_gridshift.cpp b/src/apply_gridshift.cpp
index 4c8115cc..c7070432 100644
--- a/src/apply_gridshift.cpp
+++ b/src/apply_gridshift.cpp
@@ -35,7 +35,8 @@
#include <string.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/************************************************************************/
/* pj_apply_gridshift() */
@@ -112,7 +113,7 @@ int pj_apply_gridshift_2( PJ *defn, int inverse,
/* Determine which grid is the correct given an input coordinate. */
/************************************************************************/
-static struct CTABLE* find_ctable(projCtx ctx, LP input, int grid_count, PJ_GRIDINFO **tables) {
+static struct CTABLE* find_ctable(projCtx ctx, PJ_LP input, int grid_count, PJ_GRIDINFO **tables) {
int itable;
/* keep trying till we find a table that works */
@@ -196,7 +197,7 @@ int pj_apply_gridshift_3( projCtx ctx, PJ_GRIDINFO **gridlist, int gridlist_coun
for( i = 0; i < point_count; i++ )
{
long io = i * point_offset;
- LP input, output;
+ PJ_LP input, output;
int itable;
input.phi = y[io];
@@ -306,9 +307,9 @@ int proj_hgrid_init(PJ* P, const char *grids) {
/* */
/* Return coordinate offset in grid */
/********************************************/
-LP proj_hgrid_value(PJ *P, LP lp) {
+PJ_LP proj_hgrid_value(PJ *P, PJ_LP lp) {
struct CTABLE *ct;
- LP out = proj_coord_error().lp;
+ PJ_LP out = proj_coord_error().lp;
ct = find_ctable(P->ctx, lp, P->gridlist_count, P->gridlist);
if (ct == nullptr) {
@@ -331,10 +332,10 @@ LP proj_hgrid_value(PJ *P, LP lp) {
return out;
}
-LP proj_hgrid_apply(PJ *P, LP lp, PJ_DIRECTION direction) {
+PJ_LP proj_hgrid_apply(PJ *P, PJ_LP lp, PJ_DIRECTION direction) {
struct CTABLE *ct;
int inverse;
- LP out;
+ PJ_LP out;
out.lam = HUGE_VAL; out.phi = HUGE_VAL;
diff --git a/src/apply_vgridshift.cpp b/src/apply_vgridshift.cpp
index 1facfed6..61e0c528 100644
--- a/src/apply_vgridshift.cpp
+++ b/src/apply_vgridshift.cpp
@@ -33,7 +33,7 @@
#include "proj_math.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
static int is_nodata(float value)
{
@@ -44,7 +44,7 @@ static int is_nodata(float value)
return value > 1000 || value < -1000 || value == -88.88880f;
}
-static double read_vgrid_value( PJ *defn, LP input, int *gridlist_count_p, PJ_GRIDINFO **tables, struct CTABLE *ct) {
+static double read_vgrid_value( PJ *defn, PJ_LP input, int *gridlist_count_p, PJ_GRIDINFO **tables, struct CTABLE *ct) {
int itable = 0;
double value = HUGE_VAL;
double grid_x, grid_y;
@@ -213,7 +213,7 @@ int pj_apply_vgridshift( PJ *defn, const char *listname,
{
double value;
long io = i * point_offset;
- LP input;
+ PJ_LP input;
input.phi = y[io];
input.lam = x[io];
@@ -310,7 +310,7 @@ int proj_vgrid_init(PJ* P, const char *grids) {
}
/***********************************************/
-double proj_vgrid_value(PJ *P, LP lp){
+double proj_vgrid_value(PJ *P, PJ_LP lp){
/***********************************************
Read grid value at position lp in grids loaded
diff --git a/src/apps/cct.cpp b/src/apps/cct.cpp
index 046257da..4deefba6 100644
--- a/src/apps/cct.cpp
+++ b/src/apps/cct.cpp
@@ -81,7 +81,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26
#include "proj.h"
#include "proj_internal.h"
#include "proj_strtod.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "optargpm.h"
diff --git a/src/apps/cs2cs.cpp b/src/apps/cs2cs.cpp
index f63bedcc..1e8fb474 100644
--- a/src/apps/cs2cs.cpp
+++ b/src/apps/cs2cs.cpp
@@ -43,7 +43,7 @@
// PROJ include order is sensitive
// clang-format off
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "emess.h"
// clang-format on
@@ -83,7 +83,7 @@ static void process(FILE *fid)
{
char line[MAX_LINE + 3], *s, pline[40];
- projUV data;
+ PJ_UV data;
for (;;) {
double z;
@@ -209,11 +209,11 @@ static void process(FILE *fid)
/* instanciate_crs() */
/************************************************************************/
-static PJ_OBJ *instanciate_crs(const std::string &definition,
+static PJ *instanciate_crs(const std::string &definition,
const char *const *optionsImportCRS,
bool &isGeog, double &toRadians,
bool &isLatFirst) {
- PJ_OBJ *crs = proj_obj_create_from_user_input(nullptr, definition.c_str(),
+ PJ *crs = proj_create_from_user_input(nullptr, definition.c_str(),
optionsImportCRS);
if (!crs) {
return nullptr;
@@ -223,21 +223,21 @@ static PJ_OBJ *instanciate_crs(const std::string &definition,
toRadians = 0.0;
isLatFirst = false;
- auto type = proj_obj_get_type(crs);
- if (type == PJ_OBJ_TYPE_BOUND_CRS) {
- auto base = proj_obj_get_source_crs(nullptr, crs);
- proj_obj_destroy(crs);
+ auto type = proj_get_type(crs);
+ if (type == PJ_TYPE_BOUND_CRS) {
+ auto base = proj_get_source_crs(nullptr, crs);
+ proj_destroy(crs);
crs = base;
- type = proj_obj_get_type(crs);
+ type = proj_get_type(crs);
}
- if (type == PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS ||
- type == PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS) {
- auto cs = proj_obj_crs_get_coordinate_system(nullptr, crs);
+ if (type == PJ_TYPE_GEOGRAPHIC_2D_CRS ||
+ type == PJ_TYPE_GEOGRAPHIC_3D_CRS) {
+ auto cs = proj_crs_get_coordinate_system(nullptr, crs);
assert(cs);
isGeog = true;
const char *axisName = "";
- proj_obj_cs_get_axis_info(nullptr, cs, 0,
+ proj_cs_get_axis_info(nullptr, cs, 0,
&axisName, // name,
nullptr, // abbrev
nullptr, // direction
@@ -250,7 +250,7 @@ static PJ_OBJ *instanciate_crs(const std::string &definition,
NS_PROJ::internal::ci_find(std::string(axisName), "latitude") !=
std::string::npos;
- proj_obj_destroy(cs);
+ proj_destroy(cs);
}
return crs;
@@ -260,35 +260,35 @@ static PJ_OBJ *instanciate_crs(const std::string &definition,
/* get_geog_crs_proj_string_from_proj_crs() */
/************************************************************************/
-static std::string get_geog_crs_proj_string_from_proj_crs(PJ_OBJ *src,
+static std::string get_geog_crs_proj_string_from_proj_crs(PJ *src,
double &toRadians,
bool &isLatFirst) {
- auto srcType = proj_obj_get_type(src);
- if (srcType == PJ_OBJ_TYPE_BOUND_CRS) {
- auto base = proj_obj_get_source_crs(nullptr, src);
+ auto srcType = proj_get_type(src);
+ if (srcType == PJ_TYPE_BOUND_CRS) {
+ auto base = proj_get_source_crs(nullptr, src);
assert(base);
- proj_obj_destroy(src);
+ proj_destroy(src);
src = base;
- srcType = proj_obj_get_type(src);
+ srcType = proj_get_type(src);
}
- if (srcType != PJ_OBJ_TYPE_PROJECTED_CRS) {
+ if (srcType != PJ_TYPE_PROJECTED_CRS) {
return std::string();
}
- auto base = proj_obj_get_source_crs(nullptr, src);
+ auto base = proj_get_source_crs(nullptr, src);
assert(base);
- auto baseType = proj_obj_get_type(base);
- if (baseType != PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS &&
- baseType != PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS) {
- proj_obj_destroy(base);
+ auto baseType = proj_get_type(base);
+ if (baseType != PJ_TYPE_GEOGRAPHIC_2D_CRS &&
+ baseType != PJ_TYPE_GEOGRAPHIC_3D_CRS) {
+ proj_destroy(base);
return std::string();
}
- auto cs = proj_obj_crs_get_coordinate_system(nullptr, base);
+ auto cs = proj_crs_get_coordinate_system(nullptr, base);
assert(cs);
const char *axisName = "";
- proj_obj_cs_get_axis_info(nullptr, cs, 0,
+ proj_cs_get_axis_info(nullptr, cs, 0,
&axisName, // name,
nullptr, // abbrev
nullptr, // direction
@@ -300,11 +300,11 @@ static std::string get_geog_crs_proj_string_from_proj_crs(PJ_OBJ *src,
isLatFirst = NS_PROJ::internal::ci_find(std::string(axisName),
"latitude") != std::string::npos;
- proj_obj_destroy(cs);
+ proj_destroy(cs);
- auto retCStr = proj_obj_as_proj_string(nullptr, base, PJ_PROJ_5, nullptr);
+ auto retCStr = proj_as_proj_string(nullptr, base, PJ_PROJ_5, nullptr);
std::string ret(retCStr ? retCStr : "");
- proj_obj_destroy(base);
+ proj_destroy(base);
return ret;
}
@@ -541,7 +541,7 @@ int main(int argc, char **argv) {
proj_context_get_use_proj4_init_rules(nullptr, TRUE) ? optionsProj4Mode
: nullptr;
- PJ_OBJ *src = nullptr;
+ PJ *src = nullptr;
if (!fromStr.empty()) {
bool ignored;
src = instanciate_crs(fromStr, optionsImportCRS, srcIsGeog,
@@ -551,7 +551,7 @@ int main(int argc, char **argv) {
}
}
- PJ_OBJ *dst = nullptr;
+ PJ *dst = nullptr;
if (!toStr.empty()) {
dst = instanciate_crs(toStr, optionsImportCRS, destIsGeog,
destToRadians, destIsLatLong);
@@ -581,8 +581,8 @@ int main(int argc, char **argv) {
srcIsGeog = true;
}
- proj_obj_destroy(src);
- proj_obj_destroy(dst);
+ proj_destroy(src);
+ proj_destroy(dst);
transformation = proj_create_crs_to_crs(nullptr, fromStr.c_str(),
toStr.c_str(), nullptr);
diff --git a/src/apps/gen_cheb.cpp b/src/apps/gen_cheb.cpp
index 4ba514d4..23285314 100644
--- a/src/apps/gen_cheb.cpp
+++ b/src/apps/gen_cheb.cpp
@@ -1,6 +1,7 @@
/* generates 'T' option output */
#define PJ_LIB__
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -38,17 +39,17 @@ static long strtol_type_safe(const char *s, const char ** endptr, int base)
/* FIXME: put the declaration in a header. Also used in proj.c */
-void gen_cheb(int inverse, projUV (*proj)(projUV), const char *s, PJ *P,
+void gen_cheb(int inverse, PJ_UV (*proj)(PJ_UV), const char *s, PJ *P,
int iargc, char **iargv);
extern void p_series(Tseries *, FILE *, char *);
-void gen_cheb(int inverse, projUV (*proj)(projUV), const char *s, PJ *P,
+void gen_cheb(int inverse, PJ_UV (*proj)(PJ_UV), const char *s, PJ *P,
int iargc, char **iargv) {
long NU = 15, NV = 15;
int errin = 0, pwr;
long res = -1;
char *arg, fmt[32];
- projUV low, upp, resid;
+ PJ_UV low, upp, resid;
Tseries *F;
double (*input)(const char *, const char **);
diff --git a/src/apps/geod.cpp b/src/apps/geod.cpp
index 7b6367c6..7225856e 100644
--- a/src/apps/geod.cpp
+++ b/src/apps/geod.cpp
@@ -1,7 +1,7 @@
/* <<<< Geodesic filter program >>>> */
#include "proj.h"
-# include "projects.h"
+# include "proj_internal.h"
# include "geod_interface.h"
# include "emess.h"
# include <ctype.h>
diff --git a/src/apps/geod_interface.cpp b/src/apps/geod_interface.cpp
index a30377ac..a21a89e6 100644
--- a/src/apps/geod_interface.cpp
+++ b/src/apps/geod_interface.cpp
@@ -1,4 +1,5 @@
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "geod_interface.h"
void geod_ini(void) {
diff --git a/src/apps/geod_set.cpp b/src/apps/geod_set.cpp
index b9e9c42f..cd6b5018 100644
--- a/src/apps/geod_set.cpp
+++ b/src/apps/geod_set.cpp
@@ -5,7 +5,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geod_interface.h"
#include "emess.h"
diff --git a/src/apps/gie.cpp b/src/apps/gie.cpp
index 3e4770a2..e912a076 100644
--- a/src/apps/gie.cpp
+++ b/src/apps/gie.cpp
@@ -117,7 +117,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2017-10-01/2017-10-08
#include "proj_internal.h"
#include "proj_math.h"
#include "proj_strtod.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "optargpm.h"
diff --git a/src/apps/nad2bin.cpp b/src/apps/nad2bin.cpp
index ff8f2ebd..a684b087 100644
--- a/src/apps/nad2bin.cpp
+++ b/src/apps/nad2bin.cpp
@@ -4,7 +4,7 @@
#define PJ_LIB__
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
#define U_SEC_TO_RAD 4.848136811095359935899141023e-12
/************************************************************************/
@@ -274,7 +274,7 @@ int main(int argc, char **argv) {
unsigned char achHeader[11*16];
double dfValue;
pj_int32 nGSCount = ct.lim.lam * ct.lim.phi;
- LP ur;
+ PJ_LP ur;
ur.lam = ct.ll.lam + (ct.lim.lam-1) * ct.del.lam;
ur.phi = ct.ll.phi + (ct.lim.phi-1) * ct.del.phi;
diff --git a/src/apps/p_series.cpp b/src/apps/p_series.cpp
index cddea888..2f668ce0 100644
--- a/src/apps/p_series.cpp
+++ b/src/apps/p_series.cpp
@@ -1,5 +1,6 @@
/* print row coefficients of Tseries structure */
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include <stdio.h>
#include <string.h>
#define NF 20 /* length of final format string */
diff --git a/src/apps/proj.cpp b/src/apps/proj.cpp
index b93fb04d..c8cd20a1 100644
--- a/src/apps/proj.cpp
+++ b/src/apps/proj.cpp
@@ -1,6 +1,6 @@
/* <<<< Cartographic projection filter program >>>> */
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -20,13 +20,13 @@
#define MAX_PARGS 100
#define PJ_INVERS(P) (P->inv ? 1 : 0)
-extern void gen_cheb(int, projUV(*)(projUV), const char *, PJ *, int, char **);
+extern void gen_cheb(int, PJ_UV(*)(PJ_UV), const char *, PJ *, int, char **);
static PJ *Proj;
static union {
- projUV (*generic)(projUV, PJ *);
- projXY (*fwd)(projLP, PJ *);
- projLP (*inv)(projXY, PJ *);
+ PJ_UV (*generic)(PJ_UV, PJ *);
+ PJ_XY (*fwd)(PJ_LP, PJ *);
+ PJ_LP (*inv)(PJ_XY, PJ *);
} proj;
static int
@@ -56,7 +56,7 @@ static PJ_FACTORS facs;
static double (*informat)(const char *, char **), /* input data deformatter function */
fscale = 0.; /* cartesian scale factor */
-static projUV int_proj(projUV data) {
+static PJ_UV int_proj(PJ_UV data) {
if (prescale) {
data.u *= fscale;
data.v *= fscale;
@@ -82,7 +82,7 @@ static void process(FILE *fid) {
++emess_dat.File_line;
if (bin_in) { /* binary input */
- if (fread(&data, sizeof(projUV), 1, fid) != 1)
+ if (fread(&data, sizeof(PJ_UV), 1, fid) != 1)
break;
} else { /* ascii input */
if (!(s = fgets(line, MAX_LINE, fid)))
@@ -144,7 +144,7 @@ static void process(FILE *fid) {
}
if (bin_out) { /* binary output */
- (void)fwrite(&data, sizeof(projUV), 1, stdout);
+ (void)fwrite(&data, sizeof(PJ_UV), 1, stdout);
continue;
} else if (data.uv.u == HUGE_VAL) /* error output */
(void)fputs(oterr, stdout);
@@ -196,8 +196,8 @@ static void process(FILE *fid) {
/* file processing function --- verbosely */
static void vprocess(FILE *fid) {
char line[MAX_LINE+3], *s, pline[40];
- LP dat_ll;
- projXY dat_xy;
+ PJ_LP dat_ll;
+ PJ_XY dat_xy;
int linvers;
PJ_COORD coord;
@@ -247,7 +247,7 @@ static void vprocess(FILE *fid) {
}
if (prescale) { dat_xy.x *= fscale; dat_xy.y *= fscale; }
if (reversein) {
- projXY temp = dat_xy;
+ PJ_XY temp = dat_xy;
dat_xy.x = temp.y;
dat_xy.y = temp.x;
}
@@ -260,7 +260,7 @@ static void vprocess(FILE *fid) {
continue;
}
if (reversein) {
- LP temp = dat_ll;
+ PJ_LP temp = dat_ll;
dat_ll.lam = temp.phi;
dat_ll.phi = temp.lam;
}
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index d604365a..4fcd3e5e 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -35,7 +35,8 @@
#include <iostream>
#include <utility>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include <proj/common.hpp>
#include <proj/coordinateoperation.hpp>
diff --git a/src/auth.cpp b/src/auth.cpp
index cde60a29..a8ee262a 100644
--- a/src/auth.cpp
+++ b/src/auth.cpp
@@ -3,7 +3,8 @@
#include <math.h>
#include <stddef.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
# define P00 .33333333333333333333 /* 1 / 3 */
# define P01 .17222222222222222222 /* 31 / 180 */
diff --git a/src/bch2bps.cpp b/src/bch2bps.cpp
index 3ee56993..9346457c 100644
--- a/src/bch2bps.cpp
+++ b/src/bch2bps.cpp
@@ -1,41 +1,43 @@
/* convert bivariate w Chebyshev series to w Power series */
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
/* basic support procedures */
static void /* clear vector to zero */
-clear(projUV *p, int n) { static const projUV c = {0., 0.}; while (n--) *p++ = c; }
+clear(PJ_UV *p, int n) { static const PJ_UV c = {0., 0.}; while (n--) *p++ = c; }
static void /* clear matrix rows to zero */
-bclear(projUV **p, int n, int m) { while (n--) clear(*p++, m); }
+bclear(PJ_UV **p, int n, int m) { while (n--) clear(*p++, m); }
static void /* move vector */
-bmove(projUV *a, projUV *b, int n) { while (n--) *a++ = *b++; }
+bmove(PJ_UV *a, PJ_UV *b, int n) { while (n--) *a++ = *b++; }
static void /* a <- m * b - c */
-submop(projUV *a, double m, projUV *b, projUV *c, int n) {
+submop(PJ_UV *a, double m, PJ_UV *b, PJ_UV *c, int n) {
while (n--) {
a->u = m * b->u - c->u;
a++->v = m * b++->v - c++->v;
}
}
static void /* a <- b - c */
-subop(projUV *a, projUV *b, projUV *c, int n) {
+subop(PJ_UV *a, PJ_UV *b, PJ_UV *c, int n) {
while (n--) {
a->u = b->u - c->u;
a++->v = b++->v - c++->v;
}
}
static void /* multiply vector a by scalar m */
-dmult(projUV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
+dmult(PJ_UV *a, double m, int n) { while(n--) { a->u *= m; a->v *= m; ++a; } }
static void /* row adjust a[] <- a[] - m * b[] */
-dadd(projUV *a, projUV *b, double m, int n) {
+dadd(PJ_UV *a, PJ_UV *b, double m, int n) {
while(n--) {
a->u -= m * b->u;
a++->v -= m * b++->v;
}
}
static int /* convert row to power series */
-rows(projUV *c, projUV *d, int n) {
- projUV sv, *dd;
+rows(PJ_UV *c, PJ_UV *d, int n) {
+ PJ_UV sv, *dd;
int j, k;
- dd = (projUV *)vector1(n-1, sizeof(projUV));
+ dd = (PJ_UV *)vector1(n-1, sizeof(PJ_UV));
if (!dd)
return 0;
sv.u = sv.v = 0.;
@@ -63,14 +65,14 @@ rows(projUV *c, projUV *d, int n) {
return 1;
}
static int /* convert columns to power series */
-cols(projUV **c, projUV **d, int nu, int nv) {
- projUV *sv, **dd;
+cols(PJ_UV **c, PJ_UV **d, int nu, int nv) {
+ PJ_UV *sv, **dd;
int j, k;
- dd = (projUV **)vector2(nu, nv, sizeof(projUV));
+ dd = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV));
if (!dd)
return 0;
- sv = (projUV *)vector1(nv, sizeof(projUV));
+ sv = (PJ_UV *)vector1(nv, sizeof(PJ_UV));
if (!sv) {
freev2((void **)dd, nu);
return 0;
@@ -96,7 +98,7 @@ cols(projUV **c, projUV **d, int nu, int nv) {
return 1;
}
static void /* row adjust for range -1 to 1 to a to b */
-rowshft(double a, double b, projUV *d, int n) {
+rowshft(double a, double b, PJ_UV *d, int n) {
int k, j;
double fac, cnst;
@@ -115,7 +117,7 @@ rowshft(double a, double b, projUV *d, int n) {
}
}
static void /* column adjust for range -1 to 1 to a to b */
-colshft(double a, double b, projUV **d, int n, int m) {
+colshft(double a, double b, PJ_UV **d, int n, int m) {
int k, j;
double fac, cnst;
@@ -131,11 +133,11 @@ colshft(double a, double b, projUV **d, int n, int m) {
dadd(d[k], d[k+1], cnst, m);
}
int /* entry point */
-bch2bps(projUV a, projUV b, projUV **c, int nu, int nv) {
- projUV **d;
+bch2bps(PJ_UV a, PJ_UV b, PJ_UV **c, int nu, int nv) {
+ PJ_UV **d;
int i;
- if (nu < 1 || nv < 1 || !(d = (projUV **)vector2(nu, nv, sizeof(projUV))))
+ if (nu < 1 || nv < 1 || !(d = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV))))
return 0;
/* do rows to power series */
for (i = 0; i < nu; ++i) {
diff --git a/src/bchgen.cpp b/src/bchgen.cpp
index c129f0c1..9677b6f2 100644
--- a/src/bchgen.cpp
+++ b/src/bchgen.cpp
@@ -1,9 +1,10 @@
/* generate double bivariate Chebychev polynomial */
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
int
-bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
+bchgen(PJ_UV a, PJ_UV b, int nu, int nv, PJ_UV **f, PJ_UV(*func)(PJ_UV)) {
int i, j, k;
- projUV arg, *t, bma, bpa, *c;
+ PJ_UV arg, *t, bma, bpa, *c;
double d, fac;
bma.u = 0.5 * (b.u - a.u); bma.v = 0.5 * (b.v - a.v);
@@ -17,7 +18,7 @@ bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
return(1);
}
}
- if (!(c = (projUV *) vector1(nu, sizeof(projUV)))) return 1;
+ if (!(c = (PJ_UV *) vector1(nu, sizeof(PJ_UV)))) return 1;
fac = 2. / nu;
for ( j = 0; j < nv ; ++j) {
for ( i = 0; i < nu; ++i) {
@@ -35,7 +36,7 @@ bchgen(projUV a, projUV b, int nu, int nv, projUV **f, projUV(*func)(projUV)) {
f[i][j] = c[i];
}
pj_dalloc(c);
- if (!(c = (projUV*) vector1(nv, sizeof(projUV)))) return 1;
+ if (!(c = (PJ_UV*) vector1(nv, sizeof(PJ_UV)))) return 1;
fac = 2. / nv;
for ( i = 0; i < nu; ++i) {
t = f[i];
diff --git a/src/biveval.cpp b/src/biveval.cpp
index 05e83e21..9ead2fb7 100644
--- a/src/biveval.cpp
+++ b/src/biveval.cpp
@@ -1,7 +1,8 @@
/* procedures for evaluating Tseries */
-# include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
# define NEAR_ONE 1.00001
-static double ceval(struct PW_COEF *C, int n, projUV w, projUV w2) {
+static double ceval(struct PW_COEF *C, int n, PJ_UV w, PJ_UV w2) {
double d=0, dd=0, vd, vdd, tmp, *c;
int j;
@@ -28,10 +29,10 @@ static double ceval(struct PW_COEF *C, int n, projUV w, projUV w2) {
return (w.u * d - dd);
}
-projUV /* bivariate Chebyshev polynomial entry point */
-bcheval(projUV in, Tseries *T) {
- projUV w2, w;
- projUV out;
+PJ_UV /* bivariate Chebyshev polynomial entry point */
+bcheval(PJ_UV in, Tseries *T) {
+ PJ_UV w2, w;
+ PJ_UV out;
/* scale to +-1 */
w.u = ( in.u + in.u - T->a.u ) * T->b.u;
w.v = ( in.v + in.v - T->a.v ) * T->b.v;
@@ -47,9 +48,9 @@ bcheval(projUV in, Tseries *T) {
return out;
}
-projUV /* bivariate power polynomial entry point */
-bpseval(projUV in, Tseries *T) {
- projUV out;
+PJ_UV /* bivariate power polynomial entry point */
+bpseval(PJ_UV in, Tseries *T) {
+ PJ_UV out;
double *c, row;
int i, m;
@@ -75,8 +76,8 @@ bpseval(projUV in, Tseries *T) {
return out;
}
-projUV /* general entry point selecting evaluation mode */
-biveval(projUV in, Tseries *T) {
+PJ_UV /* general entry point selecting evaluation mode */
+biveval(PJ_UV in, Tseries *T) {
if (T->power) {
return bpseval(in, T);
diff --git a/src/conversions/axisswap.cpp b/src/conversions/axisswap.cpp
index 8714ec85..18d13f8c 100644
--- a/src/conversions/axisswap.cpp
+++ b/src/conversions/axisswap.cpp
@@ -57,8 +57,9 @@ operation:
#include <stdlib.h>
#include <string.h>
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_internal.h"
-#include "projects.h"
PROJ_HEAD(axisswap, "Axis ordering");
@@ -73,7 +74,7 @@ static int sign(int x) {
return (x > 0) - (x < 0);
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -88,7 +89,7 @@ static XY forward_2d(LP lp, PJ *P) {
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -103,7 +104,7 @@ static LP reverse_2d(XY xy, PJ *P) {
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD out, in;
@@ -117,7 +118,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
return out.xyz;
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
unsigned int i;
PJ_COORD in, out;
diff --git a/src/conversions/cart.cpp b/src/conversions/cart.cpp
index 6fed9985..f8ec256b 100644
--- a/src/conversions/cart.cpp
+++ b/src/conversions/cart.cpp
@@ -43,7 +43,7 @@
#define PJ_LIB__
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(cart, "Geodetic/cartesian conversions");
@@ -131,10 +131,10 @@ static double geocentric_radius (double a, double b, double phi) {
/*********************************************************************/
-static XYZ cartesian (LPZ geod, PJ *P) {
+static PJ_XYZ cartesian (PJ_LPZ geod, PJ *P) {
/*********************************************************************/
double N, cosphi = cos(geod.phi);
- XYZ xyz;
+ PJ_XYZ xyz;
N = normal_radius_of_curvature(P->a, P->es, geod.phi);
@@ -148,10 +148,10 @@ static XYZ cartesian (LPZ geod, PJ *P) {
/*********************************************************************/
-static LPZ geodetic (XYZ cart, PJ *P) {
+static PJ_LPZ geodetic (PJ_XYZ cart, PJ *P) {
/*********************************************************************/
double N, p, theta, c, s;
- LPZ lpz;
+ PJ_LPZ lpz;
/* Perpendicular distance from point to Z-axis (HM eq. 5-28) */
p = hypot (cart.x, cart.y);
@@ -185,7 +185,7 @@ static LPZ geodetic (XYZ cart, PJ *P) {
/* In effect, 2 cartesian coordinates of a point on the ellipsoid. Rather pointless, but... */
-static XY cart_forward (LP lp, PJ *P) {
+static PJ_XY cart_forward (PJ_LP lp, PJ *P) {
PJ_COORD point;
point.lp = lp;
point.lpz.z = 0;
@@ -195,7 +195,7 @@ static XY cart_forward (LP lp, PJ *P) {
}
/* And the other way round. Still rather pointless, but... */
-static LP cart_reverse (XY xy, PJ *P) {
+static PJ_LP cart_reverse (PJ_XY xy, PJ *P) {
PJ_COORD point;
point.xy = xy;
point.xyz.z = 0;
diff --git a/src/conversions/geoc.cpp b/src/conversions/geoc.cpp
index 0455fada..66ca6199 100644
--- a/src/conversions/geoc.cpp
+++ b/src/conversions/geoc.cpp
@@ -32,7 +32,7 @@
#include "proj.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(geoc, "Geocentric Latitude");
diff --git a/src/conversions/geocent.cpp b/src/conversions/geocent.cpp
index 0e9d725e..c8d2d486 100644
--- a/src/conversions/geocent.cpp
+++ b/src/conversions/geocent.cpp
@@ -28,20 +28,22 @@
*****************************************************************************/
#define PJ_LIB__
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(geocent, "Geocentric") "\n\t";
-static XY forward(LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+static PJ_XY forward(PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = lp.lam;
xy.y = lp.phi;
return xy;
}
-static LP inverse(XY xy, PJ *P) {
- LP lp = {0.0,0.0};
+static PJ_LP inverse(PJ_XY xy, PJ *P) {
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = xy.y;
lp.lam = xy.x;
diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp
index b25fd5d2..cbd81a7d 100644
--- a/src/conversions/unitconvert.cpp
+++ b/src/conversions/unitconvert.cpp
@@ -72,7 +72,7 @@ Last update: 2017-05-16
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(unitconvert, "Unit conversion");
@@ -281,7 +281,7 @@ static const struct TIME_UNITS time_units[] = {
/***********************************************************************/
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
/************************************************************************
Forward unit conversions in the plane
************************************************************************/
@@ -297,7 +297,7 @@ static XY forward_2d(LP lp, PJ *P) {
/***********************************************************************/
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
/************************************************************************
Reverse unit conversions in the plane
************************************************************************/
@@ -313,7 +313,7 @@ static LP reverse_2d(XY xy, PJ *P) {
/***********************************************************************/
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
/************************************************************************
Forward unit conversions the vertical component
************************************************************************/
@@ -330,7 +330,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
/***********************************************************************/
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
/************************************************************************
Reverse unit conversions the vertical component
************************************************************************/
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 1742ee87..195f3b7f 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -31,7 +31,7 @@
#include "proj_experimental.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
static projCtx_t default_context;
static volatile int default_context_initialized = 0;
diff --git a/src/datum_set.cpp b/src/datum_set.cpp
index c9dfdb80..c1cb4cb9 100644
--- a/src/datum_set.cpp
+++ b/src/datum_set.cpp
@@ -28,7 +28,8 @@
#include <errno.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* SEC_TO_RAD = Pi/180/3600 */
#define SEC_TO_RAD 4.84813681109535993589914102357e-6
diff --git a/src/datums.cpp b/src/datums.cpp
index acbe12f7..5b57a713 100644
--- a/src/datums.cpp
+++ b/src/datums.cpp
@@ -30,7 +30,7 @@
#include "proj.h"
#define PJ_DATUMS__
-#include "projects.h"
+#include "proj_internal.h"
/*
* The ellipse code must match one from pj_ellps.c. The datum id should
diff --git a/src/deriv.cpp b/src/deriv.cpp
index 0e285265..bc7fa19e 100644
--- a/src/deriv.cpp
+++ b/src/deriv.cpp
@@ -3,10 +3,11 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
-int pj_deriv(LP lp, double h, const PJ *P, struct DERIVS *der) {
- XY t;
+int pj_deriv(PJ_LP lp, double h, const PJ *P, struct DERIVS *der) {
+ PJ_XY t;
/* get rid of constness until we can do it for real */
PJ *Q = (PJ *) P;
if (nullptr==Q->fwd)
diff --git a/src/dmstor.cpp b/src/dmstor.cpp
index 967a9f18..3ba66030 100644
--- a/src/dmstor.cpp
+++ b/src/dmstor.cpp
@@ -5,7 +5,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static double proj_strtod(char *nptr, char **endptr);
diff --git a/src/ell_set.cpp b/src/ell_set.cpp
index 486230a5..65049a90 100644
--- a/src/ell_set.cpp
+++ b/src/ell_set.cpp
@@ -6,7 +6,7 @@
#include "proj.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
/* Prototypes of the pj_ellipsoid helper functions */
@@ -127,7 +127,6 @@ int pj_ellipsoid (PJ *P) {
/***************************************************************************************/
static int ellps_ellps (PJ *P) {
/***************************************************************************************/
- PJ B;
const PJ_ELLPS *ellps;
paralist *par = nullptr;
char *name;
@@ -138,11 +137,6 @@ static int ellps_ellps (PJ *P) {
if (nullptr==par)
return 0;
- /* Otherwise produce a fake PJ to make ellps_size/ellps_shape do the hard work for us */
-
- /* First move B into P's context to get error messages onto the right channel */
- B.ctx = P->ctx;
-
/* Then look up the right size and shape parameters from the builtin list */
if (strlen (par->param) < 7)
return proj_errno_set (P, PJD_ERR_INVALID_ARG);
@@ -151,23 +145,28 @@ static int ellps_ellps (PJ *P) {
if (nullptr==ellps)
return proj_errno_set (P, PJD_ERR_UNKNOWN_ELLP_PARAM);
- /* Now, get things ready for ellps_size/ellps_shape, make them do their thing, and clean up */
+ /* Now, get things ready for ellps_size/ellps_shape, make them do their thing */
err = proj_errno_reset (P);
- B = *P;
- pj_erase_ellipsoid_def (&B);
- B.params = pj_mkparam (ellps->major);
- B.params->next = pj_mkparam (ellps->ell);
- ellps_size (&B);
- ellps_shape (&B);
+ paralist* new_params = pj_mkparam (ellps->major);
+ new_params->next = pj_mkparam (ellps->ell);
+ paralist* old_params = P->params;
+ P->params = new_params;
- pj_dealloc (B.params->next);
- pj_dealloc (B.params);
- if (proj_errno (&B))
- return proj_errno (&B);
+ {
+ PJ empty_PJ;
+ pj_inherit_ellipsoid_def(&empty_PJ, P);
+ }
+ ellps_size (P);
+ ellps_shape (P);
+
+ P->params = old_params;
+ pj_dealloc (new_params->next);
+ pj_dealloc (new_params);
+ if (proj_errno (P))
+ return proj_errno (P);
/* Finally update P and sail home */
- pj_inherit_ellipsoid_def (&B, P);
P->def_ellps = par->param;
par->used = 1;
@@ -440,21 +439,6 @@ static const PJ_ELLPS *pj_find_ellps (const char *name) {
/**************************************************************************************/
-void pj_erase_ellipsoid_def (PJ *P) {
-/***************************************************************************************
- Erase all ellipsoidal parameters in P
-***************************************************************************************/
- PJ B;
-
- /* Make a blank PJ to copy from */
- memset (&B, 0, sizeof (B));
-
- /* And use it to overwrite all existing ellipsoid defs */
- pj_inherit_ellipsoid_def (&B, P);
-}
-
-
-/**************************************************************************************/
void pj_inherit_ellipsoid_def (const PJ *src, PJ *dst) {
/***************************************************************************************
Brute force copy the ellipsoidal parameters from src to dst. This code was
diff --git a/src/ellps.cpp b/src/ellps.cpp
index f548d30d..7a42768b 100644
--- a/src/ellps.cpp
+++ b/src/ellps.cpp
@@ -3,7 +3,7 @@
#include <stddef.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
static const struct PJ_ELLPS
pj_ellps[] = {
diff --git a/src/errno.cpp b/src/errno.cpp
index f6ea9bfc..4f3119b3 100644
--- a/src/errno.cpp
+++ b/src/errno.cpp
@@ -1,6 +1,7 @@
/* For full ANSI compliance of global variable */
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
int pj_errno = 0;
diff --git a/src/factors.cpp b/src/factors.cpp
index 768bf585..f50c8e21 100644
--- a/src/factors.cpp
+++ b/src/factors.cpp
@@ -3,7 +3,7 @@
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
#include <errno.h>
@@ -13,7 +13,7 @@
#define EPS 1.0e-12
-int pj_factors(LP lp, const PJ *P, double h, struct FACTORS *fac) {
+int pj_factors(PJ_LP lp, const PJ *P, double h, struct FACTORS *fac) {
double cosphi, t, n, r;
int err;
PJ_COORD coo = {{0, 0, 0, 0}};
diff --git a/src/fileapi.cpp b/src/fileapi.cpp
index 3df73236..70c7b5de 100644
--- a/src/fileapi.cpp
+++ b/src/fileapi.cpp
@@ -32,7 +32,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static PAFile stdio_fopen(projCtx ctx, const char *filename,
const char *access);
diff --git a/src/fwd.cpp b/src/fwd.cpp
index e8f73999..02f31f87 100644
--- a/src/fwd.cpp
+++ b/src/fwd.cpp
@@ -33,7 +33,7 @@
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
#define INPUT_UNITS P->left
#define OUTPUT_UNITS P->right
@@ -164,7 +164,7 @@ static PJ_COORD error_or_coord(PJ *P, PJ_COORD coord, int last_errno) {
}
-XY pj_fwd(LP lp, PJ *P) {
+PJ_XY pj_fwd(PJ_LP lp, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.lp = lp;
@@ -198,7 +198,7 @@ XY pj_fwd(LP lp, PJ *P) {
-XYZ pj_fwd3d(LPZ lpz, PJ *P) {
+PJ_XYZ pj_fwd3d(PJ_LPZ lpz, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.lpz = lpz;
diff --git a/src/gauss.cpp b/src/gauss.cpp
index 2db713ad..b7a27191 100644
--- a/src/gauss.cpp
+++ b/src/gauss.cpp
@@ -28,7 +28,8 @@
#include <math.h>
#include <stdlib.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#define MAX_ITER 20
@@ -70,9 +71,9 @@ void *pj_gauss_ini(double e, double phi0, double *chi, double *rc) {
return ((void *)en);
}
-LP pj_gauss(projCtx ctx, LP elp, const void *data) {
+PJ_LP pj_gauss(projCtx ctx, PJ_LP elp, const void *data) {
const struct GAUSS *en = (const struct GAUSS *)data;
- LP slp;
+ PJ_LP slp;
(void) ctx;
slp.phi = 2. * atan( en->K *
@@ -82,9 +83,9 @@ LP pj_gauss(projCtx ctx, LP elp, const void *data) {
return(slp);
}
-LP pj_inv_gauss(projCtx ctx, LP slp, const void *data) {
+PJ_LP pj_inv_gauss(projCtx ctx, PJ_LP slp, const void *data) {
const struct GAUSS *en = (const struct GAUSS *)data;
- LP elp;
+ PJ_LP elp;
double num;
int i;
diff --git a/src/gc_reader.cpp b/src/gc_reader.cpp
index 118aadf6..def52a11 100644
--- a/src/gc_reader.cpp
+++ b/src/gc_reader.cpp
@@ -32,7 +32,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static int gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry);
diff --git a/src/gridcatalog.cpp b/src/gridcatalog.cpp
index fef2df56..ca5750ab 100644
--- a/src/gridcatalog.cpp
+++ b/src/gridcatalog.cpp
@@ -32,7 +32,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static PJ_GridCatalog *grid_catalog_list = nullptr;
@@ -122,7 +123,7 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
for( i = 0; i < point_count; i++ )
{
long io = i * point_offset;
- LP input, output_after, output_before;
+ PJ_LP input, output_after, output_before;
double mix_ratio;
PJ_GRIDINFO *gi;
@@ -236,7 +237,7 @@ int pj_gc_apply_gridshift( PJ *defn, int inverse,
/************************************************************************/
PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx, PJ_GridCatalog *catalog, int after,
- LP location, double date,
+ PJ_LP location, double date,
PJ_Region *optional_region,
double *grid_date )
{
diff --git a/src/gridinfo.cpp b/src/gridinfo.cpp
index 046abfcc..14759557 100644
--- a/src/gridinfo.cpp
+++ b/src/gridinfo.cpp
@@ -36,7 +36,7 @@
#include <string.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
/************************************************************************/
/* swap_words() */
@@ -121,7 +121,7 @@ void pj_gridinfo_free( projCtx ctx, PJ_GRIDINFO *gi )
/* stuff are loaded by pj_gridinfo_init(). */
/************************************************************************/
-int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
+int pj_gridinfo_load( projCtx_t* ctx, PJ_GRIDINFO *gi )
{
struct CTABLE ct_tmp;
@@ -155,7 +155,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
return 0;
}
- result = nad_ctable_load( ctx, &ct_tmp, fid );
+ result = nad_ctable_load( ctx, &ct_tmp, (struct projFileAPI_t*)fid );
pj_ctx_fclose( ctx, fid );
@@ -182,7 +182,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
return 0;
}
- result = nad_ctable2_load( ctx, &ct_tmp, fid );
+ result = nad_ctable2_load( ctx, &ct_tmp, (struct projFileAPI_t*)fid );
pj_ctx_fclose( ctx, fid );
@@ -483,7 +483,7 @@ static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
for( subfile = 0; subfile < num_subfiles; subfile++ )
{
struct CTABLE *ct;
- LP ur;
+ PJ_LP ur;
int gs_count;
PJ_GRIDINFO *gi;
@@ -662,7 +662,7 @@ static int pj_gridinfo_init_ntv1( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
{
unsigned char header[192]; /* 12 records of 16 bytes */
struct CTABLE *ct;
- LP ur;
+ PJ_LP ur;
/* cppcheck-suppress sizeofCalculation */
STATIC_ASSERT( sizeof(pj_int32) == 4 );
@@ -941,7 +941,7 @@ PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname )
else if( header_size >= 9 && strncmp(header + 0,"CTABLE V2",9) == 0 )
{
- struct CTABLE *ct = nad_ctable2_init( ctx, fp );
+ struct CTABLE *ct = nad_ctable2_init( ctx, (struct projFileAPI_t*)fp );
gilist->format = "ctable2";
gilist->ct = ct;
@@ -965,7 +965,7 @@ PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname )
else
{
- struct CTABLE *ct = nad_ctable_init( ctx, fp );
+ struct CTABLE *ct = nad_ctable_init( ctx, (struct projFileAPI_t*)fp );
if (ct == nullptr)
{
pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
diff --git a/src/gridlist.cpp b/src/gridlist.cpp
index 169abcb9..c540b134 100644
--- a/src/gridlist.cpp
+++ b/src/gridlist.cpp
@@ -32,7 +32,8 @@
#include <stddef.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static PJ_GRIDINFO *grid_list = nullptr;
#define PJ_MAX_PATH_LENGTH 1024
diff --git a/src/init.cpp b/src/init.cpp
index 4274f5b4..2ed34a09 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -40,7 +40,7 @@
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
/**************************************************************************************/
@@ -272,7 +272,7 @@ Expand key from buffer or (if not in buffer) from init file
if( !exists ) {
const char* const optionsProj4Mode[] = { "USE_PROJ4_INIT_RULES=YES", nullptr };
char szInitStr[7 + 64];
- PJ_OBJ* src;
+ PJ* src;
const char* proj_string;
pj_ctx_set_errno( ctx, 0 );
@@ -287,14 +287,14 @@ Expand key from buffer or (if not in buffer) from init file
strcpy(szInitStr, "+init=");
strcat(szInitStr, xkey);
- src = proj_obj_create_from_user_input(ctx, szInitStr, optionsProj4Mode);
+ src = proj_create_from_user_input(ctx, szInitStr, optionsProj4Mode);
if( !src ) {
return nullptr;
}
- proj_string = proj_obj_as_proj_string(ctx, src, PJ_PROJ_4, nullptr);
+ proj_string = proj_as_proj_string(ctx, src, PJ_PROJ_4, nullptr);
if( !proj_string ) {
- proj_obj_destroy(src);
+ proj_destroy(src);
return nullptr;
}
definition = (char*)calloc(1, strlen(proj_string)+1);
@@ -302,7 +302,7 @@ Expand key from buffer or (if not in buffer) from init file
strcpy(definition, proj_string);
}
- proj_obj_destroy(src);
+ proj_destroy(src);
}
}
diff --git a/src/initcache.cpp b/src/initcache.cpp
index 052a016c..6120a406 100644
--- a/src/initcache.cpp
+++ b/src/initcache.cpp
@@ -27,7 +27,8 @@
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static int cache_count = 0;
static int cache_alloc = 0;
diff --git a/src/internal.cpp b/src/internal.cpp
index 41744d16..f774cad6 100644
--- a/src/internal.cpp
+++ b/src/internal.cpp
@@ -39,7 +39,7 @@
#include "geodesic.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
enum pj_io_units pj_left (PJ *P) {
diff --git a/src/inv.cpp b/src/inv.cpp
index ba7e6722..83c5498c 100644
--- a/src/inv.cpp
+++ b/src/inv.cpp
@@ -32,7 +32,7 @@
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
#define INPUT_UNITS P->right
#define OUTPUT_UNITS P->left
@@ -141,7 +141,7 @@ static PJ_COORD error_or_coord(PJ *P, PJ_COORD coord, int last_errno) {
}
-LP pj_inv(XY xy, PJ *P) {
+PJ_LP pj_inv(PJ_XY xy, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.xy = xy;
@@ -175,7 +175,7 @@ LP pj_inv(XY xy, PJ *P) {
-LPZ pj_inv3d (XYZ xyz, PJ *P) {
+PJ_LPZ pj_inv3d (PJ_XYZ xyz, PJ *P) {
int last_errno;
PJ_COORD coo = {{0,0,0,0}};
coo.xyz = xyz;
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index d0b5d720..7f51e613 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -50,10 +50,9 @@
// PROJ include order is sensitive
// clang-format off
-#include "proj_internal.h"
#include "proj.h"
+#include "proj_internal.h"
#include "proj_experimental.h"
-#include "projects.h"
// clang-format on
#include "proj_constants.h"
@@ -90,49 +89,6 @@ static void PROJ_NO_INLINE proj_log_debug(PJ_CONTEXT *ctx, const char *function,
// ---------------------------------------------------------------------------
-/** \brief Opaque object representing a Ellipsoid, Datum, CRS or Coordinate
- * Operation. Should be used by at most one thread at a time. */
-struct PJ_OBJ {
- //! @cond Doxygen_Suppress
- IdentifiedObjectNNPtr obj;
-
- // cached results
- mutable std::string lastWKT{};
- mutable std::string lastPROJString{};
- mutable bool gridsNeededAsked = false;
- mutable std::vector<GridDescription> gridsNeeded{};
-
- explicit PJ_OBJ(const IdentifiedObjectNNPtr &objIn) : obj(objIn) {}
- static PJ_OBJ *create(const IdentifiedObjectNNPtr &objIn);
-
- PJ_OBJ(const PJ_OBJ &) = delete;
- PJ_OBJ &operator=(const PJ_OBJ &) = delete;
- //! @endcond
-};
-
-//! @cond Doxygen_Suppress
-PJ_OBJ *PJ_OBJ::create(const IdentifiedObjectNNPtr &objIn) {
- return new PJ_OBJ(objIn);
-}
-//! @endcond
-
-// ---------------------------------------------------------------------------
-
-/** \brief Opaque object representing a set of operation results. */
-struct PJ_OBJ_LIST {
- //! @cond Doxygen_Suppress
- std::vector<IdentifiedObjectNNPtr> objects;
-
- explicit PJ_OBJ_LIST(std::vector<IdentifiedObjectNNPtr> &&objectsIn)
- : objects(std::move(objectsIn)) {}
-
- PJ_OBJ_LIST(const PJ_OBJ_LIST &) = delete;
- PJ_OBJ_LIST &operator=(const PJ_OBJ_LIST &) = delete;
- //! @endcond
-};
-
-// ---------------------------------------------------------------------------
-
//! @cond Doxygen_Suppress
/** Auxiliary structure to PJ_CONTEXT storing C++ context stuff. */
@@ -168,15 +124,6 @@ void proj_context_delete_cpp_context(struct projCppContext *cppContext) {
//! @cond Doxygen_Suppress
-#define SANITIZE_CTX(ctx) \
- do { \
- if (ctx == nullptr) { \
- ctx = pj_get_default_ctx(); \
- } \
- } while (0)
-
-// ---------------------------------------------------------------------------
-
static PROJ_NO_INLINE const DatabaseContextNNPtr &
getDBcontext(PJ_CONTEXT *ctx) {
if (ctx->cpp_context == nullptr) {
@@ -196,6 +143,57 @@ getDBcontextNoException(PJ_CONTEXT *ctx, const char *function) {
return nullptr;
}
}
+// ---------------------------------------------------------------------------
+
+static PJ *pj_obj_create(PJ_CONTEXT *ctx, const IdentifiedObjectNNPtr &objIn) {
+ auto coordop = dynamic_cast<const CoordinateOperation *>(objIn.get());
+ if (coordop) {
+ auto dbContext = getDBcontextNoException(ctx, __FUNCTION__);
+ try {
+ auto formatter = PROJStringFormatter::create(
+ PROJStringFormatter::Convention::PROJ_5, dbContext);
+ auto pj = proj_create(
+ ctx, coordop->exportToPROJString(formatter.get()).c_str());
+ if (pj) {
+ pj->iso_obj = objIn;
+ return pj;
+ }
+ } catch (const std::exception &e) {
+ proj_log_debug(ctx, __FUNCTION__, e.what());
+ }
+ }
+ auto pj = new PJ();
+ pj->descr = "ISO-19111 object";
+ pj->iso_obj = objIn;
+ return pj;
+}
+//! @endcond
+
+// ---------------------------------------------------------------------------
+
+/** \brief Opaque object representing a set of operation results. */
+struct PJ_OBJ_LIST {
+ //! @cond Doxygen_Suppress
+ std::vector<IdentifiedObjectNNPtr> objects;
+
+ explicit PJ_OBJ_LIST(std::vector<IdentifiedObjectNNPtr> &&objectsIn)
+ : objects(std::move(objectsIn)) {}
+
+ PJ_OBJ_LIST(const PJ_OBJ_LIST &) = delete;
+ PJ_OBJ_LIST &operator=(const PJ_OBJ_LIST &) = delete;
+ //! @endcond
+};
+
+// ---------------------------------------------------------------------------
+
+//! @cond Doxygen_Suppress
+
+#define SANITIZE_CTX(ctx) \
+ do { \
+ if (ctx == nullptr) { \
+ ctx = pj_get_default_ctx(); \
+ } \
+ } while (0)
//! @endcond
@@ -313,20 +311,23 @@ static const char *getOptionValue(const char *option,
/** \brief "Clone" an object.
*
* Technically this just increases the reference counter on the object, since
- * PJ_OBJ objects are immutable.
+ * PJ objects are immutable.
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Object to clone. Must not be NULL.
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_clone(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
try {
- return PJ_OBJ::create(obj->obj);
+ return pj_obj_create(ctx, NN_NO_CHECK(obj->iso_obj));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -341,7 +342,7 @@ PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
*
* This function calls osgeo::proj::io::createFromUserInput()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
@@ -357,11 +358,11 @@ PJ_OBJ *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* Orientated projection). In that mode, the epsg:XXXX syntax will be also
* interprated the same way.</li>
* </ul>
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
- const char *const *options) {
+PJ *proj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(text);
(void)options;
@@ -382,7 +383,7 @@ PJ_OBJ *proj_obj_create_from_user_input(PJ_CONTEXT *ctx, const char *text,
auto identifiedObject = nn_dynamic_pointer_cast<IdentifiedObject>(
createFromUserInput(text, dbContext, usePROJ4InitRules));
if (identifiedObject) {
- return PJ_OBJ::create(NN_NO_CHECK(identifiedObject));
+ return pj_obj_create(ctx, NN_NO_CHECK(identifiedObject));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -418,7 +419,7 @@ template <class T> static PROJ_STRING_LIST to_string_list(T &&set) {
*
* This function calls osgeo::proj::io::WKTParser::createFromWKT()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
@@ -436,13 +437,13 @@ template <class T> static PROJ_STRING_LIST to_string_list(T &&set) {
* @param out_grammar_errors Pointer to a PROJ_STRING_LIST object, or NULL.
* If provided, *out_grammar_errors will contain a list of errors regarding the
* WKT grammaer. It must be freed with proj_string_list_destroy().
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
- const char *const *options,
- PROJ_STRING_LIST *out_warnings,
- PROJ_STRING_LIST *out_grammar_errors) {
+PJ *proj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
+ const char *const *options,
+ PROJ_STRING_LIST *out_warnings,
+ PROJ_STRING_LIST *out_grammar_errors) {
SANITIZE_CTX(ctx);
assert(wkt);
@@ -501,7 +502,7 @@ PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
}
if (obj) {
- return PJ_OBJ::create(NN_NO_CHECK(obj));
+ return pj_obj_create(ctx, NN_NO_CHECK(obj));
}
} catch (const std::exception &e) {
if (out_grammar_errors) {
@@ -524,18 +525,17 @@ PJ_OBJ *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
*
* This function calls osgeo::proj::io::PROJStringParser::createFromPROJString()
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param proj_string PROJ string (must not be NULL)
* @param options should be set to NULL for now
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
- const char *proj_string,
- const char *const *options) {
+PJ *proj_create_from_proj_string(PJ_CONTEXT *ctx, const char *proj_string,
+ const char *const *options) {
SANITIZE_CTX(ctx);
(void)options;
assert(proj_string);
@@ -548,7 +548,7 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
auto identifiedObject = nn_dynamic_pointer_cast<IdentifiedObject>(
parser.createFromPROJString(proj_string));
if (identifiedObject) {
- return PJ_OBJ::create(NN_NO_CHECK(identifiedObject));
+ return pj_obj_create(ctx, NN_NO_CHECK(identifiedObject));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -560,7 +560,7 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
/** \brief Instanciate an object from a database lookup.
*
- * The returned object must be unreferenced with proj_obj_destroy() after use.
+ * The returned object must be unreferenced with proj_destroy() after use.
* It should be used by at most one thread at a time.
*
* @param ctx Context, or NULL for default context.
@@ -571,14 +571,13 @@ PJ_OBJ *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
* should be substituted to the official grid names. Only used on
* transformations
* @param options should be set to NULL for now
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL in
+ * @return Object that must be unreferenced with proj_destroy(), or NULL in
* case of error.
*/
-PJ_OBJ *proj_obj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
- const char *code,
- PJ_OBJ_CATEGORY category,
- int usePROJAlternativeGridNames,
- const char *const *options) {
+PJ *proj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
+ const char *code, PJ_CATEGORY category,
+ int usePROJAlternativeGridNames,
+ const char *const *options) {
assert(auth_name);
assert(code);
(void)options;
@@ -588,27 +587,27 @@ PJ_OBJ *proj_obj_create_from_database(PJ_CONTEXT *ctx, const char *auth_name,
auto factory = AuthorityFactory::create(getDBcontext(ctx), auth_name);
IdentifiedObjectPtr obj;
switch (category) {
- case PJ_OBJ_CATEGORY_ELLIPSOID:
+ case PJ_CATEGORY_ELLIPSOID:
obj = factory->createEllipsoid(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_PRIME_MERIDIAN:
+ case PJ_CATEGORY_PRIME_MERIDIAN:
obj = factory->createPrimeMeridian(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_DATUM:
+ case PJ_CATEGORY_DATUM:
obj = factory->createDatum(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_CRS:
+ case PJ_CATEGORY_CRS:
obj =
factory->createCoordinateReferenceSystem(codeStr).as_nullable();
break;
- case PJ_OBJ_CATEGORY_COORDINATE_OPERATION:
+ case PJ_CATEGORY_COORDINATE_OPERATION:
obj = factory
->createCoordinateOperation(
codeStr, usePROJAlternativeGridNames != 0)
.as_nullable();
break;
}
- return PJ_OBJ::create(NN_NO_CHECK(obj));
+ return pj_obj_create(ctx, NN_NO_CHECK(obj));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -701,13 +700,13 @@ int proj_uom_get_info_from_database(PJ_CONTEXT *ctx, const char *auth_name,
* @param datum_code Datum code (must not be NULL)
* @param crs_type "geographic 2D", "geographic 3D", "geocentric" or NULL
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_auth_name,
- const char *datum_auth_name,
- const char *datum_code,
- const char *crs_type) {
+PJ_OBJ_LIST *proj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
+ const char *crs_auth_name,
+ const char *datum_auth_name,
+ const char *datum_code,
+ const char *crs_type) {
assert(datum_auth_name);
assert(datum_code);
SANITIZE_CTX(ctx);
@@ -729,114 +728,103 @@ PJ_OBJ_LIST *proj_obj_query_geodetic_crs_from_datum(PJ_CONTEXT *ctx,
// ---------------------------------------------------------------------------
-/** \brief Drops a reference on an object.
- *
- * This method should be called one and exactly one for each function
- * returning a PJ_OBJ*
- *
- * @param obj Object, or NULL.
- */
-void proj_obj_destroy(PJ_OBJ *obj) { delete obj; }
-
-// ---------------------------------------------------------------------------
-
//! @cond Doxygen_Suppress
static AuthorityFactory::ObjectType
-convertPJObjectTypeToObjectType(PJ_OBJ_TYPE type, bool &valid) {
+convertPJObjectTypeToObjectType(PJ_TYPE type, bool &valid) {
valid = true;
AuthorityFactory::ObjectType cppType = AuthorityFactory::ObjectType::CRS;
switch (type) {
- case PJ_OBJ_TYPE_ELLIPSOID:
+ case PJ_TYPE_ELLIPSOID:
cppType = AuthorityFactory::ObjectType::ELLIPSOID;
break;
- case PJ_OBJ_TYPE_PRIME_MERIDIAN:
+ case PJ_TYPE_PRIME_MERIDIAN:
cppType = AuthorityFactory::ObjectType::PRIME_MERIDIAN;
break;
- case PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME:
- case PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME:
+ case PJ_TYPE_GEODETIC_REFERENCE_FRAME:
+ case PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME:
cppType = AuthorityFactory::ObjectType::GEODETIC_REFERENCE_FRAME;
break;
- case PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME:
- case PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME:
+ case PJ_TYPE_VERTICAL_REFERENCE_FRAME:
+ case PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME:
cppType = AuthorityFactory::ObjectType::VERTICAL_REFERENCE_FRAME;
break;
- case PJ_OBJ_TYPE_DATUM_ENSEMBLE:
+ case PJ_TYPE_DATUM_ENSEMBLE:
cppType = AuthorityFactory::ObjectType::DATUM;
break;
- case PJ_OBJ_TYPE_CRS:
+ case PJ_TYPE_CRS:
cppType = AuthorityFactory::ObjectType::CRS;
break;
- case PJ_OBJ_TYPE_GEODETIC_CRS:
+ case PJ_TYPE_GEODETIC_CRS:
cppType = AuthorityFactory::ObjectType::GEODETIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOCENTRIC_CRS:
+ case PJ_TYPE_GEOCENTRIC_CRS:
cppType = AuthorityFactory::ObjectType::GEOCENTRIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_CRS:
+ case PJ_TYPE_GEOGRAPHIC_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS:
+ case PJ_TYPE_GEOGRAPHIC_2D_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_2D_CRS;
break;
- case PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS:
+ case PJ_TYPE_GEOGRAPHIC_3D_CRS:
cppType = AuthorityFactory::ObjectType::GEOGRAPHIC_3D_CRS;
break;
- case PJ_OBJ_TYPE_VERTICAL_CRS:
+ case PJ_TYPE_VERTICAL_CRS:
cppType = AuthorityFactory::ObjectType::VERTICAL_CRS;
break;
- case PJ_OBJ_TYPE_PROJECTED_CRS:
+ case PJ_TYPE_PROJECTED_CRS:
cppType = AuthorityFactory::ObjectType::PROJECTED_CRS;
break;
- case PJ_OBJ_TYPE_COMPOUND_CRS:
+ case PJ_TYPE_COMPOUND_CRS:
cppType = AuthorityFactory::ObjectType::COMPOUND_CRS;
break;
- case PJ_OBJ_TYPE_ENGINEERING_CRS:
+ case PJ_TYPE_ENGINEERING_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_TEMPORAL_CRS:
+ case PJ_TYPE_TEMPORAL_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_BOUND_CRS:
+ case PJ_TYPE_BOUND_CRS:
valid = false;
break;
- case PJ_OBJ_TYPE_OTHER_CRS:
+ case PJ_TYPE_OTHER_CRS:
cppType = AuthorityFactory::ObjectType::CRS;
break;
- case PJ_OBJ_TYPE_CONVERSION:
+ case PJ_TYPE_CONVERSION:
cppType = AuthorityFactory::ObjectType::CONVERSION;
break;
- case PJ_OBJ_TYPE_TRANSFORMATION:
+ case PJ_TYPE_TRANSFORMATION:
cppType = AuthorityFactory::ObjectType::TRANSFORMATION;
break;
- case PJ_OBJ_TYPE_CONCATENATED_OPERATION:
+ case PJ_TYPE_CONCATENATED_OPERATION:
cppType = AuthorityFactory::ObjectType::CONCATENATED_OPERATION;
break;
- case PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION:
+ case PJ_TYPE_OTHER_COORDINATE_OPERATION:
cppType = AuthorityFactory::ObjectType::COORDINATE_OPERATION;
break;
- case PJ_OBJ_TYPE_UNKNOWN:
+ case PJ_TYPE_UNKNOWN:
valid = false;
break;
}
@@ -860,14 +848,14 @@ convertPJObjectTypeToObjectType(PJ_OBJ_TYPE type, bool &valid) {
* Or 0 for unlimited.
* @param options should be set to NULL for now
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
- const char *searchedName,
- const PJ_OBJ_TYPE *types,
- size_t typesCount, int approximateMatch,
- size_t limitResultCount,
- const char *const *options) {
+PJ_OBJ_LIST *proj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
+ const char *searchedName,
+ const PJ_TYPE *types, size_t typesCount,
+ int approximateMatch,
+ size_t limitResultCount,
+ const char *const *options) {
assert(searchedName);
assert((types != nullptr && typesCount > 0) ||
(types == nullptr && typesCount == 0));
@@ -905,40 +893,43 @@ PJ_OBJ_LIST *proj_obj_create_from_name(PJ_CONTEXT *ctx, const char *auth_name,
* @param obj Object (must not be NULL)
* @return its type.
*/
-PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
+PJ_TYPE proj_get_type(const PJ *obj) {
assert(obj);
- auto ptr = obj->obj.get();
+ if (!obj->iso_obj) {
+ return PJ_TYPE_UNKNOWN;
+ }
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<Ellipsoid *>(ptr)) {
- return PJ_OBJ_TYPE_ELLIPSOID;
+ return PJ_TYPE_ELLIPSOID;
}
if (dynamic_cast<PrimeMeridian *>(ptr)) {
- return PJ_OBJ_TYPE_PRIME_MERIDIAN;
+ return PJ_TYPE_PRIME_MERIDIAN;
}
if (dynamic_cast<DynamicGeodeticReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME;
+ return PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME;
}
if (dynamic_cast<GeodeticReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME;
+ return PJ_TYPE_GEODETIC_REFERENCE_FRAME;
}
if (dynamic_cast<DynamicVerticalReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME;
+ return PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME;
}
if (dynamic_cast<VerticalReferenceFrame *>(ptr)) {
- return PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME;
+ return PJ_TYPE_VERTICAL_REFERENCE_FRAME;
}
if (dynamic_cast<DatumEnsemble *>(ptr)) {
- return PJ_OBJ_TYPE_DATUM_ENSEMBLE;
+ return PJ_TYPE_DATUM_ENSEMBLE;
}
{
auto crs = dynamic_cast<GeographicCRS *>(ptr);
if (crs) {
if (crs->coordinateSystem()->axisList().size() == 2) {
- return PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS;
+ return PJ_TYPE_GEOGRAPHIC_2D_CRS;
} else {
- return PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS;
+ return PJ_TYPE_GEOGRAPHIC_3D_CRS;
}
}
}
@@ -947,49 +938,49 @@ PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
auto crs = dynamic_cast<GeodeticCRS *>(ptr);
if (crs) {
if (crs->isGeocentric()) {
- return PJ_OBJ_TYPE_GEOCENTRIC_CRS;
+ return PJ_TYPE_GEOCENTRIC_CRS;
} else {
- return PJ_OBJ_TYPE_GEODETIC_CRS;
+ return PJ_TYPE_GEODETIC_CRS;
}
}
}
if (dynamic_cast<VerticalCRS *>(ptr)) {
- return PJ_OBJ_TYPE_VERTICAL_CRS;
+ return PJ_TYPE_VERTICAL_CRS;
}
if (dynamic_cast<ProjectedCRS *>(ptr)) {
- return PJ_OBJ_TYPE_PROJECTED_CRS;
+ return PJ_TYPE_PROJECTED_CRS;
}
if (dynamic_cast<CompoundCRS *>(ptr)) {
- return PJ_OBJ_TYPE_COMPOUND_CRS;
+ return PJ_TYPE_COMPOUND_CRS;
}
if (dynamic_cast<TemporalCRS *>(ptr)) {
- return PJ_OBJ_TYPE_TEMPORAL_CRS;
+ return PJ_TYPE_TEMPORAL_CRS;
}
if (dynamic_cast<EngineeringCRS *>(ptr)) {
- return PJ_OBJ_TYPE_ENGINEERING_CRS;
+ return PJ_TYPE_ENGINEERING_CRS;
}
if (dynamic_cast<BoundCRS *>(ptr)) {
- return PJ_OBJ_TYPE_BOUND_CRS;
+ return PJ_TYPE_BOUND_CRS;
}
if (dynamic_cast<CRS *>(ptr)) {
- return PJ_OBJ_TYPE_OTHER_CRS;
+ return PJ_TYPE_OTHER_CRS;
}
if (dynamic_cast<Conversion *>(ptr)) {
- return PJ_OBJ_TYPE_CONVERSION;
+ return PJ_TYPE_CONVERSION;
}
if (dynamic_cast<Transformation *>(ptr)) {
- return PJ_OBJ_TYPE_TRANSFORMATION;
+ return PJ_TYPE_TRANSFORMATION;
}
if (dynamic_cast<ConcatenatedOperation *>(ptr)) {
- return PJ_OBJ_TYPE_CONCATENATED_OPERATION;
+ return PJ_TYPE_CONCATENATED_OPERATION;
}
if (dynamic_cast<CoordinateOperation *>(ptr)) {
- return PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION;
+ return PJ_TYPE_OTHER_COORDINATE_OPERATION;
}
- return PJ_OBJ_TYPE_UNKNOWN;
+ return PJ_TYPE_UNKNOWN;
}
// ---------------------------------------------------------------------------
@@ -999,9 +990,12 @@ PJ_OBJ_TYPE proj_obj_get_type(const PJ_OBJ *obj) {
* @param obj Object (must not be NULL)
* @return TRUE if it is deprecated, FALSE otherwise
*/
-int proj_obj_is_deprecated(const PJ_OBJ *obj) {
+int proj_is_deprecated(const PJ *obj) {
assert(obj);
- return obj->obj->isDeprecated();
+ if (!obj->iso_obj) {
+ return false;
+ }
+ return obj->iso_obj->isDeprecated();
}
// ---------------------------------------------------------------------------
@@ -1012,12 +1006,12 @@ int proj_obj_is_deprecated(const PJ_OBJ *obj) {
* @param obj Object (of type CRS for now) for which non-deprecated objects
* must be searched. Must not be NULL
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ_OBJ_LIST *proj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ *obj) {
assert(obj);
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -1043,10 +1037,16 @@ PJ_OBJ_LIST *proj_obj_get_non_deprecated(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* @param criterion Comparison criterion
* @return TRUE if they are equivalent
*/
-int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
- PJ_COMPARISON_CRITERION criterion) {
+int proj_is_equivalent_to(const PJ *obj, const PJ *other,
+ PJ_COMPARISON_CRITERION criterion) {
assert(obj);
assert(other);
+ if (!obj->iso_obj) {
+ return false;
+ }
+ if (!other->iso_obj) {
+ return false;
+ }
// Make sure that the C and C++ enumerations match
static_assert(static_cast<int>(PJ_COMP_STRICT) ==
@@ -1071,7 +1071,7 @@ int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
}
const IComparable::Criterion cppCriterion =
static_cast<IComparable::Criterion>(criterion);
- return obj->obj->isEquivalentTo(other->obj.get(), cppCriterion);
+ return obj->iso_obj->isEquivalentTo(other->iso_obj.get(), cppCriterion);
}
// ---------------------------------------------------------------------------
@@ -1080,9 +1080,9 @@ int proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ *other,
*
* @param obj Object (must not be NULL)
*/
-int proj_obj_is_crs(const PJ_OBJ *obj) {
+int proj_is_crs(const PJ *obj) {
assert(obj);
- return dynamic_cast<CRS *>(obj->obj.get()) != nullptr;
+ return dynamic_cast<CRS *>(obj->iso_obj.get()) != nullptr;
}
// ---------------------------------------------------------------------------
@@ -1094,9 +1094,12 @@ int proj_obj_is_crs(const PJ_OBJ *obj) {
* @param obj Object (must not be NULL)
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_name(const PJ_OBJ *obj) {
+const char *proj_get_name(const PJ *obj) {
assert(obj);
- const auto &desc = obj->obj->name()->description();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &desc = obj->iso_obj->name()->description();
if (!desc.has_value()) {
return nullptr;
}
@@ -1115,9 +1118,12 @@ const char *proj_obj_get_name(const PJ_OBJ *obj) {
* @param index Index of the identifier. 0 = first identifier
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_id_auth_name(const PJ_OBJ *obj, int index) {
+const char *proj_get_id_auth_name(const PJ *obj, int index) {
assert(obj);
- const auto &ids = obj->obj->identifiers();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &ids = obj->iso_obj->identifiers();
if (static_cast<size_t>(index) >= ids.size()) {
return nullptr;
}
@@ -1140,9 +1146,12 @@ const char *proj_obj_get_id_auth_name(const PJ_OBJ *obj, int index) {
* @param index Index of the identifier. 0 = first identifier
* @return a string, or NULL in case of error or missing name.
*/
-const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
+const char *proj_get_id_code(const PJ *obj, int index) {
assert(obj);
- const auto &ids = obj->obj->identifiers();
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
+ const auto &ids = obj->iso_obj->identifiers();
if (static_cast<size_t>(index) >= ids.size()) {
return nullptr;
}
@@ -1154,7 +1163,7 @@ const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
/** \brief Get a WKT representation of an object.
*
* The returned string is valid while the input obj parameter is valid,
- * and until a next call to proj_obj_as_wkt() with the same input object.
+ * and until a next call to proj_as_wkt() with the same input object.
*
* This function calls osgeo::proj::io::IWKTExportable::exportToWKT().
*
@@ -1177,10 +1186,13 @@ const char *proj_obj_get_id_code(const PJ_OBJ *obj, int index) {
* </ul>
* @return a string, or NULL in case of error.
*/
-const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- PJ_WKT_TYPE type, const char *const *options) {
+const char *proj_as_wkt(PJ_CONTEXT *ctx, const PJ *obj, PJ_WKT_TYPE type,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(obj);
+ if (!obj->iso_obj) {
+ return nullptr;
+ }
// Make sure that the C and C++ enumerations match
static_assert(static_cast<int>(PJ_WKT2_2015) ==
@@ -1239,7 +1251,7 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
return nullptr;
}
}
- obj->lastWKT = obj->obj->exportToWKT(formatter.get());
+ obj->lastWKT = obj->iso_obj->exportToWKT(formatter.get());
return obj->lastWKT.c_str();
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -1252,7 +1264,7 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
/** \brief Get a PROJ string representation of an object.
*
* The returned string is valid while the input obj parameter is valid,
- * and until a next call to proj_obj_as_proj_string() with the same input
+ * and until a next call to proj_as_proj_string() with the same input
* object.
*
* This function calls
@@ -1271,13 +1283,13 @@ const char *proj_obj_as_wkt(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* use of etmerc by utm conversions)
* @return a string, or NULL in case of error.
*/
-const char *proj_obj_as_proj_string(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- PJ_PROJ_STRING_TYPE type,
- const char *const *options) {
+const char *proj_as_proj_string(PJ_CONTEXT *ctx, const PJ *obj,
+ PJ_PROJ_STRING_TYPE type,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(obj);
auto exportable =
- dynamic_cast<const IPROJStringExportable *>(obj->obj.get());
+ dynamic_cast<const IPROJStringExportable *>(obj->iso_obj.get());
if (!exportable) {
proj_log_error(ctx, __FUNCTION__, "Object type not exportable to PROJ");
return nullptr;
@@ -1339,17 +1351,17 @@ const char *proj_obj_as_proj_string(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @return TRUE in case of success, FALSE in case of error or if the area
* of use is unknown.
*/
-int proj_obj_get_area_of_use(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- double *out_west_lon_degree,
- double *out_south_lat_degree,
- double *out_east_lon_degree,
- double *out_north_lat_degree,
- const char **out_area_name) {
+int proj_get_area_of_use(PJ_CONTEXT *ctx, const PJ *obj,
+ double *out_west_lon_degree,
+ double *out_south_lat_degree,
+ double *out_east_lon_degree,
+ double *out_north_lat_degree,
+ const char **out_area_name) {
(void)ctx;
if (out_area_name) {
*out_area_name = nullptr;
}
- auto objectUsage = dynamic_cast<const ObjectUsage *>(obj->obj.get());
+ auto objectUsage = dynamic_cast<const ObjectUsage *>(obj->iso_obj.get());
if (!objectUsage) {
return false;
}
@@ -1403,10 +1415,10 @@ int proj_obj_get_area_of_use(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
// ---------------------------------------------------------------------------
-static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
+static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ *crs,
const char *fname) {
assert(crs);
- auto l_crs = dynamic_cast<const CRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const CRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, fname, "Object is not a CRS");
return nullptr;
@@ -1422,30 +1434,31 @@ static const GeodeticCRS *extractGeodeticCRS(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
/** \brief Get the geodeticCRS / geographicCRS from a CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type CRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
auto geodCRS = extractGeodeticCRS(ctx, crs, __FUNCTION__);
if (!geodCRS) {
return nullptr;
}
- return PJ_OBJ::create(NN_NO_CHECK(nn_dynamic_pointer_cast<IdentifiedObject>(
- geodCRS->shared_from_this())));
+ return pj_obj_create(ctx,
+ NN_NO_CHECK(nn_dynamic_pointer_cast<IdentifiedObject>(
+ geodCRS->shared_from_this())));
}
// ---------------------------------------------------------------------------
/** \brief Get a CRS component from a CompoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1453,14 +1466,13 @@ PJ_OBJ *proj_obj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @param crs Objet of type CRS (must not be NULL)
* @param index Index of the CRS component (typically 0 = horizontal, 1 =
* vertical)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
- int index) {
+PJ *proj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ *crs, int index) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<CompoundCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<CompoundCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CompoundCRS");
return nullptr;
@@ -1469,14 +1481,14 @@ PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
if (static_cast<size_t>(index) >= components.size()) {
return nullptr;
}
- return PJ_OBJ::create(components[index]);
+ return pj_obj_create(ctx, components[index]);
}
// ---------------------------------------------------------------------------
/** \brief Returns a BoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1484,36 +1496,36 @@ PJ_OBJ *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs,
* @param base_crs Base CRS (must not be NULL)
* @param hub_crs Hub CRS (must not be NULL)
* @param transformation Transformation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
- const PJ_OBJ *hub_crs,
- const PJ_OBJ *transformation) {
+PJ *proj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ *base_crs,
+ const PJ *hub_crs, const PJ *transformation) {
SANITIZE_CTX(ctx);
assert(base_crs);
assert(hub_crs);
assert(transformation);
- auto l_base_crs = util::nn_dynamic_pointer_cast<CRS>(base_crs->obj);
+ auto l_base_crs = std::dynamic_pointer_cast<CRS>(base_crs->iso_obj);
if (!l_base_crs) {
proj_log_error(ctx, __FUNCTION__, "base_crs is not a CRS");
return nullptr;
}
- auto l_hub_crs = util::nn_dynamic_pointer_cast<CRS>(hub_crs->obj);
+ auto l_hub_crs = std::dynamic_pointer_cast<CRS>(hub_crs->iso_obj);
if (!l_hub_crs) {
proj_log_error(ctx, __FUNCTION__, "hub_crs is not a CRS");
return nullptr;
}
auto l_transformation =
- util::nn_dynamic_pointer_cast<Transformation>(transformation->obj);
+ std::dynamic_pointer_cast<Transformation>(transformation->iso_obj);
if (!l_transformation) {
proj_log_error(ctx, __FUNCTION__, "transformation is not a CRS");
return nullptr;
}
try {
- return PJ_OBJ::create(BoundCRS::create(NN_NO_CHECK(l_base_crs),
- NN_NO_CHECK(l_hub_crs),
- NN_NO_CHECK(l_transformation)));
+ return pj_obj_create(ctx,
+ BoundCRS::create(NN_NO_CHECK(l_base_crs),
+ NN_NO_CHECK(l_hub_crs),
+ NN_NO_CHECK(l_transformation)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -1525,7 +1537,7 @@ PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
/** \brief Returns potentially
* a BoundCRS, with a transformation to EPSG:4326, wrapping this CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -1541,15 +1553,14 @@ PJ_OBJ *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx, const PJ_OBJ *base_crs,
* intermediate CRS may be considered when computing the possible
* tranformations. Slower.</li>
* </ul>
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
- const PJ_OBJ *crs,
- const char *const *options) {
+PJ *proj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx, const PJ *crs,
+ const char *const *options) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const CRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const CRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CRS");
return nullptr;
@@ -1568,8 +1579,8 @@ PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
return nullptr;
}
}
- return PJ_OBJ::create(l_crs->createBoundCRSToWGS84IfPossible(
- dbContext, allowIntermediateCRS));
+ return pj_obj_create(ctx, l_crs->createBoundCRSToWGS84IfPossible(
+ dbContext, allowIntermediateCRS));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -1580,27 +1591,27 @@ PJ_OBJ *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
/** \brief Get the ellipsoid from a CRS or a GeodeticReferenceFrame.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type CRS or GeodeticReferenceFrame (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<const CRS *>(ptr)) {
auto geodCRS = extractGeodeticCRS(ctx, obj, __FUNCTION__);
if (geodCRS) {
- return PJ_OBJ::create(geodCRS->ellipsoid());
+ return pj_obj_create(ctx, geodCRS->ellipsoid());
}
} else {
auto datum = dynamic_cast<const GeodeticReferenceFrame *>(ptr);
if (datum) {
- return PJ_OBJ::create(datum->ellipsoid());
+ return pj_obj_create(ctx, datum->ellipsoid());
}
}
proj_log_error(ctx, __FUNCTION__,
@@ -1612,16 +1623,16 @@ PJ_OBJ *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
/** \brief Get the horizontal datum from a CRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type CRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
auto geodCRS = extractGeodeticCRS(ctx, crs, __FUNCTION__);
if (!geodCRS) {
@@ -1629,12 +1640,12 @@ PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
}
const auto &datum = geodCRS->datum();
if (datum) {
- return PJ_OBJ::create(NN_NO_CHECK(datum));
+ return pj_obj_create(ctx, NN_NO_CHECK(datum));
}
const auto &datumEnsemble = geodCRS->datumEnsemble();
if (datumEnsemble) {
- return PJ_OBJ::create(NN_NO_CHECK(datumEnsemble));
+ return pj_obj_create(ctx, NN_NO_CHECK(datumEnsemble));
}
proj_log_error(ctx, __FUNCTION__, "CRS has no datum");
return nullptr;
@@ -1660,14 +1671,15 @@ PJ_OBJ *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* flattening. or NULL
* @return TRUE in case of success.
*/
-int proj_obj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ_OBJ *ellipsoid,
- double *out_semi_major_metre,
- double *out_semi_minor_metre,
- int *out_is_semi_minor_computed,
- double *out_inv_flattening) {
+int proj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ *ellipsoid,
+ double *out_semi_major_metre,
+ double *out_semi_minor_metre,
+ int *out_is_semi_minor_computed,
+ double *out_inv_flattening) {
SANITIZE_CTX(ctx);
assert(ellipsoid);
- auto l_ellipsoid = dynamic_cast<const Ellipsoid *>(ellipsoid->obj.get());
+ auto l_ellipsoid =
+ dynamic_cast<const Ellipsoid *>(ellipsoid->iso_obj.get());
if (!l_ellipsoid) {
proj_log_error(ctx, __FUNCTION__, "Object is not a Ellipsoid");
return FALSE;
@@ -1694,28 +1706,28 @@ int proj_obj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ_OBJ *ellipsoid,
/** \brief Get the prime meridian of a CRS or a GeodeticReferenceFrame.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type CRS or GeodeticReferenceFrame (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
if (dynamic_cast<CRS *>(ptr)) {
auto geodCRS = extractGeodeticCRS(ctx, obj, __FUNCTION__);
if (geodCRS) {
- return PJ_OBJ::create(geodCRS->primeMeridian());
+ return pj_obj_create(ctx, geodCRS->primeMeridian());
}
} else {
auto datum = dynamic_cast<const GeodeticReferenceFrame *>(ptr);
if (datum) {
- return PJ_OBJ::create(datum->primeMeridian());
+ return pj_obj_create(ctx, datum->primeMeridian());
}
}
proj_log_error(ctx, __FUNCTION__,
@@ -1737,14 +1749,15 @@ PJ_OBJ *proj_obj_get_prime_meridian(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* or NULL
* @return TRUE in case of success.
*/
-int proj_obj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
- const PJ_OBJ *prime_meridian,
- double *out_longitude,
- double *out_unit_conv_factor,
- const char **out_unit_name) {
+int proj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
+ const PJ *prime_meridian,
+ double *out_longitude,
+ double *out_unit_conv_factor,
+ const char **out_unit_name) {
SANITIZE_CTX(ctx);
assert(prime_meridian);
- auto l_pm = dynamic_cast<const PrimeMeridian *>(prime_meridian->obj.get());
+ auto l_pm =
+ dynamic_cast<const PrimeMeridian *>(prime_meridian->iso_obj.get());
if (!l_pm) {
proj_log_error(ctx, __FUNCTION__, "Object is not a PrimeMeridian");
return false;
@@ -1768,32 +1781,32 @@ int proj_obj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
/** \brief Return the base CRS of a BoundCRS or a DerivedCRS/ProjectedCRS, or
* the source CRS of a CoordinateOperation.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type BoundCRS or CoordinateOperation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error, or missing source CRS.
*/
-PJ_OBJ *proj_obj_get_source_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_source_crs(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
assert(obj);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto boundCRS = dynamic_cast<const BoundCRS *>(ptr);
if (boundCRS) {
- return PJ_OBJ::create(boundCRS->baseCRS());
+ return pj_obj_create(ctx, boundCRS->baseCRS());
}
auto derivedCRS = dynamic_cast<const DerivedCRS *>(ptr);
if (derivedCRS) {
- return PJ_OBJ::create(derivedCRS->baseCRS());
+ return pj_obj_create(ctx, derivedCRS->baseCRS());
}
auto co = dynamic_cast<const CoordinateOperation *>(ptr);
if (co) {
auto sourceCRS = co->sourceCRS();
if (sourceCRS) {
- return PJ_OBJ::create(NN_NO_CHECK(sourceCRS));
+ return pj_obj_create(ctx, NN_NO_CHECK(sourceCRS));
}
return nullptr;
}
@@ -1807,28 +1820,28 @@ PJ_OBJ *proj_obj_get_source_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
/** \brief Return the hub CRS of a BoundCRS or the target CRS of a
* CoordinateOperation.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param obj Objet of type BoundCRS or CoordinateOperation (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error, or missing target CRS.
*/
-PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
+PJ *proj_get_target_crs(PJ_CONTEXT *ctx, const PJ *obj) {
SANITIZE_CTX(ctx);
assert(obj);
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto boundCRS = dynamic_cast<const BoundCRS *>(ptr);
if (boundCRS) {
- return PJ_OBJ::create(boundCRS->hubCRS());
+ return pj_obj_create(ctx, boundCRS->hubCRS());
}
auto co = dynamic_cast<const CoordinateOperation *>(ptr);
if (co) {
auto targetCRS = co->targetCRS();
if (targetCRS) {
- return PJ_OBJ::create(NN_NO_CHECK(targetCRS));
+ return pj_obj_create(ctx, NN_NO_CHECK(targetCRS));
}
return nullptr;
}
@@ -1867,22 +1880,21 @@ PJ_OBJ *proj_obj_get_target_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj) {
* @param out_confidence Output parameter. Pointer to an array of integers that
* will be allocated by the function and filled with the confidence values
* (0-100). There are as many elements in this array as
- * proj_obj_list_get_count()
+ * proj_list_get_count()
* returns on the return value of this function. *confidence should be
* released with proj_int_list_destroy().
* @return a list of matching reference CRS, or nullptr in case of error.
*/
-PJ_OBJ_LIST *proj_obj_identify(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *auth_name,
- const char *const *options,
- int **out_confidence) {
+PJ_OBJ_LIST *proj_identify(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *auth_name, const char *const *options,
+ int **out_confidence) {
SANITIZE_CTX(ctx);
assert(obj);
(void)options;
if (out_confidence) {
*out_confidence = nullptr;
}
- auto ptr = obj->obj.get();
+ auto ptr = obj->iso_obj.get();
auto crs = dynamic_cast<const CRS *>(ptr);
if (!crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CRS");
@@ -1960,7 +1972,7 @@ PROJ_STRING_LIST proj_get_authorities_from_database(PJ_CONTEXT *ctx) {
*/
PROJ_STRING_LIST proj_get_codes_from_database(PJ_CONTEXT *ctx,
const char *auth_name,
- PJ_OBJ_TYPE type,
+ PJ_TYPE type,
int allow_deprecated) {
assert(auth_name);
SANITIZE_CTX(ctx);
@@ -1997,25 +2009,25 @@ void proj_string_list_destroy(PROJ_STRING_LIST list) {
/** \brief Return the Conversion of a DerivedCRS (such as a ProjectedCRS),
* or the Transformation from the baseCRS to the hubCRS of a BoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type DerivedCRS or BoundCRSs (must not be NULL)
* @return Object of type SingleOperation that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
SingleOperationPtr co;
- auto derivedCRS = dynamic_cast<const DerivedCRS *>(crs->obj.get());
+ auto derivedCRS = dynamic_cast<const DerivedCRS *>(crs->iso_obj.get());
if (derivedCRS) {
co = derivedCRS->derivingConversion().as_nullable();
} else {
- auto boundCRS = dynamic_cast<const BoundCRS *>(crs->obj.get());
+ auto boundCRS = dynamic_cast<const BoundCRS *>(crs->iso_obj.get());
if (boundCRS) {
co = boundCRS->transformation().as_nullable();
} else {
@@ -2025,7 +2037,7 @@ PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
}
}
- return PJ_OBJ::create(NN_NO_CHECK(co));
+ return pj_obj_create(ctx, NN_NO_CHECK(co));
}
// ---------------------------------------------------------------------------
@@ -2044,7 +2056,7 @@ PJ_OBJ *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @return TRUE in case of success.
*/
int proj_coordoperation_get_method_info(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char **out_method_name,
const char **out_method_auth_name,
const char **out_method_code) {
@@ -2052,7 +2064,7 @@ int proj_coordoperation_get_method_info(PJ_CONTEXT *ctx,
assert(coordoperation);
auto singleOp =
- dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!singleOp) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a DerivedCRS or BoundCRS");
@@ -2197,7 +2209,7 @@ static GeodeticReferenceFrameNNPtr createGeodeticReferenceFrame(
/** \brief Create a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2218,17 +2230,19 @@ static GeodeticReferenceFrameNNPtr createGeodeticReferenceFrame(
* @param ellipsoidal_cs Coordinate system. Must not be NULL.
*
* @return Object of type GeographicCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geographic_crs(
- PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
- const char *ellps_name, double semi_major_metre, double inv_flattening,
- const char *prime_meridian_name, double prime_meridian_offset,
- const char *pm_angular_units, double pm_angular_units_conv,
- PJ_OBJ *ellipsoidal_cs) {
+PJ *proj_create_geographic_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const char *datum_name, const char *ellps_name,
+ double semi_major_metre, double inv_flattening,
+ const char *prime_meridian_name,
+ double prime_meridian_offset,
+ const char *pm_angular_units,
+ double pm_angular_units_conv,
+ PJ *ellipsoidal_cs) {
SANITIZE_CTX(ctx);
- auto cs = util::nn_dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->obj);
+ auto cs = std::dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->iso_obj);
if (!cs) {
return nullptr;
}
@@ -2239,7 +2253,7 @@ PJ_OBJ *proj_obj_create_geographic_crs(
pm_angular_units_conv);
auto geogCRS = GeographicCRS::create(createPropertyMapName(crs_name),
datum, NN_NO_CHECK(cs));
- return PJ_OBJ::create(geogCRS);
+ return pj_obj_create(ctx, geogCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2250,7 +2264,7 @@ PJ_OBJ *proj_obj_create_geographic_crs(
/** \brief Create a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2260,22 +2274,20 @@ PJ_OBJ *proj_obj_create_geographic_crs(
* @param ellipsoidal_cs Coordinate system. Must not be NULL.
*
* @return Object of type GeographicCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_name,
- PJ_OBJ *datum,
- PJ_OBJ *ellipsoidal_cs) {
+PJ *proj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
+ PJ *datum, PJ *ellipsoidal_cs) {
SANITIZE_CTX(ctx);
auto l_datum =
- util::nn_dynamic_pointer_cast<GeodeticReferenceFrame>(datum->obj);
+ std::dynamic_pointer_cast<GeodeticReferenceFrame>(datum->iso_obj);
if (!l_datum) {
proj_log_error(ctx, __FUNCTION__,
"datum is not a GeodeticReferenceFrame");
return nullptr;
}
- auto cs = util::nn_dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->obj);
+ auto cs = std::dynamic_pointer_cast<EllipsoidalCS>(ellipsoidal_cs->iso_obj);
if (!cs) {
return nullptr;
}
@@ -2283,7 +2295,7 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
auto geogCRS =
GeographicCRS::create(createPropertyMapName(crs_name),
NN_NO_CHECK(l_datum), NN_NO_CHECK(cs));
- return PJ_OBJ::create(geogCRS);
+ return pj_obj_create(ctx, geogCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2294,7 +2306,7 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
/** \brief Create a GeodeticCRS of geocentric type.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2316,9 +2328,9 @@ PJ_OBJ *proj_obj_create_geographic_crs_from_datum(PJ_CONTEXT *ctx,
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type GeodeticCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geocentric_crs(
+PJ *proj_create_geocentric_crs(
PJ_CONTEXT *ctx, const char *crs_name, const char *datum_name,
const char *ellps_name, double semi_major_metre, double inv_flattening,
const char *prime_meridian_name, double prime_meridian_offset,
@@ -2337,7 +2349,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
auto geodCRS =
GeodeticCRS::create(createPropertyMapName(crs_name), datum,
cs::CartesianCS::createGeocentric(linearUnit));
- return PJ_OBJ::create(geodCRS);
+ return pj_obj_create(ctx, geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2348,7 +2360,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
/** \brief Create a GeodeticCRS of geocentric type.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2360,19 +2372,18 @@ PJ_OBJ *proj_obj_create_geocentric_crs(
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type GeodeticCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
- const char *crs_name,
- const PJ_OBJ *datum,
- const char *linear_units,
- double linear_units_conv) {
+PJ *proj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx, const char *crs_name,
+ const PJ *datum,
+ const char *linear_units,
+ double linear_units_conv) {
SANITIZE_CTX(ctx);
try {
const UnitOfMeasure linearUnit(
createLinearUnit(linear_units, linear_units_conv));
auto l_datum =
- util::nn_dynamic_pointer_cast<GeodeticReferenceFrame>(datum->obj);
+ std::dynamic_pointer_cast<GeodeticReferenceFrame>(datum->iso_obj);
if (!l_datum) {
proj_log_error(ctx, __FUNCTION__,
"datum is not a GeodeticReferenceFrame");
@@ -2381,7 +2392,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
auto geodCRS = GeodeticCRS::create(
createPropertyMapName(crs_name), NN_NO_CHECK(l_datum),
cs::CartesianCS::createGeocentric(linearUnit));
- return PJ_OBJ::create(geodCRS);
+ return pj_obj_create(ctx, geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2392,7 +2403,7 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
/** \brief Create a VerticalCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2404,12 +2415,11 @@ PJ_OBJ *proj_obj_create_geocentric_crs_from_datum(PJ_CONTEXT *ctx,
* 0 for Metre if linear_units == NULL. Otherwise should be not NULL
*
* @return Object of type VerticalCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
- const char *datum_name,
- const char *linear_units,
- double linear_units_conv) {
+PJ *proj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const char *datum_name, const char *linear_units,
+ double linear_units_conv) {
SANITIZE_CTX(ctx);
try {
@@ -2420,7 +2430,7 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
auto vertCRS = VerticalCRS::create(
createPropertyMapName(crs_name), datum,
cs::VerticalCS::createGravityRelatedHeight(linearUnit));
- return PJ_OBJ::create(vertCRS);
+ return pj_obj_create(ctx, vertCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2431,7 +2441,7 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
/** \brief Create a CompoundCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2441,19 +2451,19 @@ PJ_OBJ *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx, const char *crs_name,
* @param vert_crs Vertical CRS. must not be NULL.
*
* @return Object of type CompoundCRS that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
- PJ_OBJ *horiz_crs, PJ_OBJ *vert_crs) {
+PJ *proj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ PJ *horiz_crs, PJ *vert_crs) {
assert(horiz_crs);
assert(vert_crs);
SANITIZE_CTX(ctx);
- auto l_horiz_crs = util::nn_dynamic_pointer_cast<CRS>(horiz_crs->obj);
+ auto l_horiz_crs = std::dynamic_pointer_cast<CRS>(horiz_crs->iso_obj);
if (!l_horiz_crs) {
return nullptr;
}
- auto l_vert_crs = util::nn_dynamic_pointer_cast<CRS>(vert_crs->obj);
+ auto l_vert_crs = std::dynamic_pointer_cast<CRS>(vert_crs->iso_obj);
if (!l_vert_crs) {
return nullptr;
}
@@ -2461,7 +2471,7 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
auto compoundCRS = CompoundCRS::create(
createPropertyMapName(crs_name),
{NN_NO_CHECK(l_horiz_crs), NN_NO_CHECK(l_vert_crs)});
- return PJ_OBJ::create(compoundCRS);
+ return pj_obj_create(ctx, compoundCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2474,7 +2484,7 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
*
* Currently, only implemented on CRS objects.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2483,17 +2493,16 @@ PJ_OBJ *proj_obj_create_compound_crs(PJ_CONTEXT *ctx, const char *crs_name,
* @param name New name. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *name) {
+PJ PROJ_DLL *proj_alter_name(PJ_CONTEXT *ctx, const PJ *obj, const char *name) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
try {
- return PJ_OBJ::create(crs->alterName(name));
+ return pj_obj_create(ctx, crs->alterName(name));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2506,7 +2515,7 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* Currently, only implemented on CRS objects.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2516,17 +2525,17 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param code Code. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *auth_name, const char *code) {
+PJ PROJ_DLL *proj_alter_id(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *auth_name, const char *code) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
try {
- return PJ_OBJ::create(crs->alterId(auth_name, code));
+ return pj_obj_create(ctx, crs->alterId(auth_name, code));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -2543,7 +2552,7 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* CRS with new_geod_crs.
* In other cases, it returns a clone of obj.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2552,27 +2561,27 @@ PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param new_geod_crs Object of type GeodeticCRS. Must not be NULL
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const PJ_OBJ *new_geod_crs) {
+PJ *proj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ *obj,
+ const PJ *new_geod_crs) {
SANITIZE_CTX(ctx);
auto l_new_geod_crs =
- util::nn_dynamic_pointer_cast<GeodeticCRS>(new_geod_crs->obj);
+ std::dynamic_pointer_cast<GeodeticCRS>(new_geod_crs->iso_obj);
if (!l_new_geod_crs) {
proj_log_error(ctx, __FUNCTION__, "new_geod_crs is not a GeodeticCRS");
return nullptr;
}
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
proj_log_error(ctx, __FUNCTION__, "obj is not a CRS");
return nullptr;
}
try {
- return PJ_OBJ::create(
- crs->alterGeodeticCRS(NN_NO_CHECK(l_new_geod_crs)));
+ return pj_obj_create(
+ ctx, crs->alterGeodeticCRS(NN_NO_CHECK(l_new_geod_crs)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2585,7 +2594,7 @@ PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a GeographicCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2598,42 +2607,43 @@ PJ_OBJ *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param unit_code Unit code. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *angular_units,
- double angular_units_conv,
- const char *unit_auth_name,
- const char *unit_code) {
+PJ *proj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *angular_units,
+ double angular_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code) {
SANITIZE_CTX(ctx);
- auto geodCRS = proj_obj_crs_get_geodetic_crs(ctx, obj);
+ auto geodCRS = proj_crs_get_geodetic_crs(ctx, obj);
if (!geodCRS) {
return nullptr;
}
- auto geogCRS = dynamic_cast<const GeographicCRS *>(geodCRS->obj.get());
+ auto geogCRS = dynamic_cast<const GeographicCRS *>(geodCRS->iso_obj.get());
if (!geogCRS) {
- proj_obj_destroy(geodCRS);
+ proj_destroy(geodCRS);
return nullptr;
}
- PJ_OBJ *geogCRSAltered = nullptr;
+ PJ *geogCRSAltered = nullptr;
try {
const UnitOfMeasure angUnit(createAngularUnit(
angular_units, angular_units_conv, unit_auth_name, unit_code));
- geogCRSAltered = PJ_OBJ::create(GeographicCRS::create(
- createPropertyMapName(proj_obj_get_name(geodCRS)), geogCRS->datum(),
- geogCRS->datumEnsemble(),
- geogCRS->coordinateSystem()->alterAngularUnit(angUnit)));
- proj_obj_destroy(geodCRS);
+ geogCRSAltered = pj_obj_create(
+ ctx, GeographicCRS::create(
+ createPropertyMapName(proj_get_name(geodCRS)),
+ geogCRS->datum(), geogCRS->datumEnsemble(),
+ geogCRS->coordinateSystem()->alterAngularUnit(angUnit)));
+ proj_destroy(geodCRS);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
- proj_obj_destroy(geodCRS);
+ proj_destroy(geodCRS);
return nullptr;
}
- auto ret = proj_obj_crs_alter_geodetic_crs(ctx, obj, geogCRSAltered);
- proj_obj_destroy(geogCRSAltered);
+ auto ret = proj_crs_alter_geodetic_crs(ctx, obj, geogCRSAltered);
+ proj_destroy(geogCRSAltered);
return ret;
}
@@ -2644,7 +2654,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a ProjectedCRS, VerticalCRS or a GeocentricCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2657,15 +2667,15 @@ PJ_OBJ *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* @param unit_code Unit code. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
- const char *linear_units,
- double linear_units_conv,
- const char *unit_auth_name,
- const char *unit_code) {
+PJ *proj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *linear_units,
+ double linear_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const CRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const CRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -2673,7 +2683,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
try {
const UnitOfMeasure linearUnit(createLinearUnit(
linear_units, linear_units_conv, unit_auth_name, unit_code));
- return PJ_OBJ::create(crs->alterCSLinearUnit(linearUnit));
+ return pj_obj_create(ctx, crs->alterCSLinearUnit(linearUnit));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2687,7 +2697,7 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
*
* The CRS must be or contain a ProjectedCRS, VerticalCRS or a GeocentricCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2704,14 +2714,16 @@ PJ_OBJ *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx, const PJ_OBJ *obj,
* equivalent to the original one for reprojection purposes).
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
- PJ_CONTEXT *ctx, const PJ_OBJ *obj, const char *linear_units,
- double linear_units_conv, const char *unit_auth_name, const char *unit_code,
- int convert_to_new_unit) {
+PJ *proj_crs_alter_parameters_linear_unit(PJ_CONTEXT *ctx, const PJ *obj,
+ const char *linear_units,
+ double linear_units_conv,
+ const char *unit_auth_name,
+ const char *unit_code,
+ int convert_to_new_unit) {
SANITIZE_CTX(ctx);
- auto crs = dynamic_cast<const ProjectedCRS *>(obj->obj.get());
+ auto crs = dynamic_cast<const ProjectedCRS *>(obj->iso_obj.get());
if (!crs) {
return nullptr;
}
@@ -2719,8 +2731,8 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
try {
const UnitOfMeasure linearUnit(createLinearUnit(
linear_units, linear_units_conv, unit_auth_name, unit_code));
- return PJ_OBJ::create(crs->alterParametersLinearUnit(
- linearUnit, convert_to_new_unit == TRUE));
+ return pj_obj_create(ctx, crs->alterParametersLinearUnit(
+ linearUnit, convert_to_new_unit == TRUE));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2731,7 +2743,7 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
/** \brief Instanciate a EngineeringCRS with just a name
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2739,16 +2751,17 @@ PJ_OBJ *proj_obj_crs_alter_parameters_linear_unit(
* @param crs_name CRS name. Or NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ PROJ_DLL *proj_obj_create_engineering_crs(PJ_CONTEXT *ctx,
- const char *crs_name) {
+PJ PROJ_DLL *proj_create_engineering_crs(PJ_CONTEXT *ctx,
+ const char *crs_name) {
SANITIZE_CTX(ctx);
try {
- return PJ_OBJ::create(EngineeringCRS::create(
- createPropertyMapName(crs_name),
- EngineeringDatum::create(PropertyMap()),
- CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)));
+ return pj_obj_create(
+ ctx, EngineeringCRS::create(
+ createPropertyMapName(crs_name),
+ EngineeringDatum::create(PropertyMap()),
+ CartesianCS::createEastingNorthing(UnitOfMeasure::METRE)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2830,7 +2843,7 @@ static void setSingleOperationElements(
/** \brief Instanciate a Conversion
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2845,15 +2858,15 @@ static void setSingleOperationElements(
* @param params Parameter descriptions (array of size param_count)
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
- const char *auth_name, const char *code,
- const char *method_name,
- const char *method_auth_name,
- const char *method_code, int param_count,
- const PJ_PARAM_DESCRIPTION *params) {
+PJ *proj_create_conversion(PJ_CONTEXT *ctx, const char *name,
+ const char *auth_name, const char *code,
+ const char *method_name,
+ const char *method_auth_name,
+ const char *method_code, int param_count,
+ const PJ_PARAM_DESCRIPTION *params) {
SANITIZE_CTX(ctx);
try {
PropertyMap propSingleOp;
@@ -2865,8 +2878,8 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
name, auth_name, code, method_name, method_auth_name, method_code,
param_count, params, propSingleOp, propMethod, parameters, values);
- return PJ_OBJ::create(
- Conversion::create(propSingleOp, propMethod, parameters, values));
+ return pj_obj_create(ctx, Conversion::create(propSingleOp, propMethod,
+ parameters, values));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2877,7 +2890,7 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
/** \brief Instanciate a Transformation
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -2900,26 +2913,28 @@ PJ_OBJ *proj_obj_create_conversion(PJ_CONTEXT *ctx, const char *name,
* values means unknown.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_transformation(
- PJ_CONTEXT *ctx, const char *name, const char *auth_name, const char *code,
- PJ_OBJ *source_crs, PJ_OBJ *target_crs, PJ_OBJ *interpolation_crs,
- const char *method_name, const char *method_auth_name,
- const char *method_code, int param_count,
- const PJ_PARAM_DESCRIPTION *params, double accuracy) {
+PJ *proj_create_transformation(PJ_CONTEXT *ctx, const char *name,
+ const char *auth_name, const char *code,
+ PJ *source_crs, PJ *target_crs,
+ PJ *interpolation_crs, const char *method_name,
+ const char *method_auth_name,
+ const char *method_code, int param_count,
+ const PJ_PARAM_DESCRIPTION *params,
+ double accuracy) {
SANITIZE_CTX(ctx);
assert(source_crs);
assert(target_crs);
- auto l_sourceCRS = util::nn_dynamic_pointer_cast<CRS>(source_crs->obj);
+ auto l_sourceCRS = std::dynamic_pointer_cast<CRS>(source_crs->iso_obj);
if (!l_sourceCRS) {
proj_log_error(ctx, __FUNCTION__, "source_crs is not a CRS");
return nullptr;
}
- auto l_targetCRS = util::nn_dynamic_pointer_cast<CRS>(target_crs->obj);
+ auto l_targetCRS = std::dynamic_pointer_cast<CRS>(target_crs->iso_obj);
if (!l_targetCRS) {
proj_log_error(ctx, __FUNCTION__, "target_crs is not a CRS");
return nullptr;
@@ -2928,7 +2943,7 @@ PJ_OBJ *proj_obj_create_transformation(
CRSPtr l_interpolationCRS;
if (interpolation_crs) {
l_interpolationCRS =
- util::nn_dynamic_pointer_cast<CRS>(interpolation_crs->obj);
+ std::dynamic_pointer_cast<CRS>(interpolation_crs->iso_obj);
if (!l_interpolationCRS) {
proj_log_error(ctx, __FUNCTION__, "interpolation_crs is not a CRS");
return nullptr;
@@ -2951,9 +2966,11 @@ PJ_OBJ *proj_obj_create_transformation(
PositionalAccuracy::create(toString(accuracy)));
}
- return PJ_OBJ::create(Transformation::create(
- propSingleOp, NN_NO_CHECK(l_sourceCRS), NN_NO_CHECK(l_targetCRS),
- l_interpolationCRS, propMethod, parameters, values, accuracies));
+ return pj_obj_create(
+ ctx,
+ Transformation::create(propSingleOp, NN_NO_CHECK(l_sourceCRS),
+ NN_NO_CHECK(l_targetCRS), l_interpolationCRS,
+ propMethod, parameters, values, accuracies));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -2984,13 +3001,14 @@ PJ_OBJ *proj_obj_create_transformation(
* @param new_method_name EPSG or PROJ target method name. Or nullptr (in which
* case new_method_epsg_code must be specified).
* @return new conversion that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_convert_conversion_to_other_method(
- PJ_CONTEXT *ctx, const PJ_OBJ *conversion, int new_method_epsg_code,
- const char *new_method_name) {
+PJ *proj_convert_conversion_to_other_method(PJ_CONTEXT *ctx,
+ const PJ *conversion,
+ int new_method_epsg_code,
+ const char *new_method_name) {
SANITIZE_CTX(ctx);
- auto conv = dynamic_cast<const Conversion *>(conversion->obj.get());
+ auto conv = dynamic_cast<const Conversion *>(conversion->iso_obj.get());
if (!conv) {
proj_log_error(ctx, __FUNCTION__, "not a Conversion");
return nullptr;
@@ -3019,7 +3037,7 @@ PJ_OBJ *proj_obj_convert_conversion_to_other_method(
auto new_conv = conv->convertToOtherMethod(new_method_epsg_code);
if (!new_conv)
return nullptr;
- return PJ_OBJ::create(NN_NO_CHECK(new_conv));
+ return pj_obj_create(ctx, NN_NO_CHECK(new_conv));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
return nullptr;
@@ -3072,7 +3090,7 @@ static CoordinateSystemAxisNNPtr createAxis(const PJ_AXIS_DESCRIPTION &axis) {
/** \brief Instanciate a CoordinateSystem.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3082,11 +3100,11 @@ static CoordinateSystemAxisNNPtr createAxis(const PJ_AXIS_DESCRIPTION &axis) {
* @param axis Axis description (array of size axis_count)
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
- int axis_count, const PJ_AXIS_DESCRIPTION *axis) {
+PJ *proj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
+ int axis_count, const PJ_AXIS_DESCRIPTION *axis) {
try {
switch (type) {
case PJ_CS_TYPE_UNKNOWN:
@@ -3094,31 +3112,37 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
case PJ_CS_TYPE_CARTESIAN: {
if (axis_count == 2) {
- return PJ_OBJ::create(CartesianCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1])));
+ return pj_obj_create(
+ ctx, CartesianCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1])));
} else if (axis_count == 3) {
- return PJ_OBJ::create(CartesianCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, CartesianCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]),
+ createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_ELLIPSOIDAL: {
if (axis_count == 2) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1])));
+ return pj_obj_create(
+ ctx,
+ EllipsoidalCS::create(PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1])));
} else if (axis_count == 3) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::create(
+ PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]), createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_VERTICAL: {
if (axis_count == 1) {
- return PJ_OBJ::create(
+ return pj_obj_create(
+ ctx,
VerticalCS::create(PropertyMap(), createAxis(axis[0])));
}
break;
@@ -3126,16 +3150,18 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
case PJ_CS_TYPE_SPHERICAL: {
if (axis_count == 3) {
- return PJ_OBJ::create(EllipsoidalCS::create(
- PropertyMap(), createAxis(axis[0]), createAxis(axis[1]),
- createAxis(axis[2])));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::create(
+ PropertyMap(), createAxis(axis[0]),
+ createAxis(axis[1]), createAxis(axis[2])));
}
break;
}
case PJ_CS_TYPE_PARAMETRIC: {
if (axis_count == 1) {
- return PJ_OBJ::create(
+ return pj_obj_create(
+ ctx,
ParametricCS::create(PropertyMap(), createAxis(axis[0])));
}
break;
@@ -3147,29 +3173,33 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
axisVector.emplace_back(createAxis(axis[i]));
}
- return PJ_OBJ::create(OrdinalCS::create(PropertyMap(), axisVector));
+ return pj_obj_create(ctx,
+ OrdinalCS::create(PropertyMap(), axisVector));
}
case PJ_CS_TYPE_DATETIMETEMPORAL: {
if (axis_count == 1) {
- return PJ_OBJ::create(DateTimeTemporalCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, DateTimeTemporalCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
case PJ_CS_TYPE_TEMPORALCOUNT: {
if (axis_count == 1) {
- return PJ_OBJ::create(TemporalCountCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, TemporalCountCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
case PJ_CS_TYPE_TEMPORALMEASURE: {
if (axis_count == 1) {
- return PJ_OBJ::create(TemporalMeasureCS::create(
- PropertyMap(), createAxis(axis[0])));
+ return pj_obj_create(
+ ctx, TemporalMeasureCS::create(PropertyMap(),
+ createAxis(axis[0])));
}
break;
}
@@ -3187,7 +3217,7 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
/** \brief Instanciate a CartesiansCS 2D
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3197,36 +3227,38 @@ PJ_OBJ *proj_obj_create_cs(PJ_CONTEXT *ctx, PJ_COORDINATE_SYSTEM_TYPE type,
* @param unit_conv_factor Unit conversion factor to SI.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
- PJ_CARTESIAN_CS_2D_TYPE type,
- const char *unit_name,
- double unit_conv_factor) {
+PJ *proj_create_cartesian_2D_cs(PJ_CONTEXT *ctx, PJ_CARTESIAN_CS_2D_TYPE type,
+ const char *unit_name,
+ double unit_conv_factor) {
try {
switch (type) {
case PJ_CART2D_EASTING_NORTHING:
- return PJ_OBJ::create(CartesianCS::createEastingNorthing(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createEastingNorthing(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_NORTHING_EASTING:
- return PJ_OBJ::create(CartesianCS::createNorthingEasting(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createNorthingEasting(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_NORTH_POLE_EASTING_SOUTH_NORTHING_SOUTH:
- return PJ_OBJ::create(
- CartesianCS::createNorthPoleEastingSouthNorthingSouth(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createNorthPoleEastingSouthNorthingSouth(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_SOUTH_POLE_EASTING_NORTH_NORTHING_NORTH:
- return PJ_OBJ::create(
- CartesianCS::createSouthPoleEastingNorthNorthingNorth(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createSouthPoleEastingNorthNorthingNorth(
+ createLinearUnit(unit_name, unit_conv_factor)));
case PJ_CART2D_WESTING_SOUTHING:
- return PJ_OBJ::create(CartesianCS::createWestingSouthing(
- createLinearUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, CartesianCS::createWestingSouthing(
+ createLinearUnit(unit_name, unit_conv_factor)));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -3238,7 +3270,7 @@ PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
/** \brief Instanciate a Ellipsoidal 2D
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3248,22 +3280,24 @@ PJ_OBJ *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
* @param unit_conv_factor Unit conversion factor to SI.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
- PJ_ELLIPSOIDAL_CS_2D_TYPE type,
- const char *unit_name,
- double unit_conv_factor) {
+PJ *proj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
+ PJ_ELLIPSOIDAL_CS_2D_TYPE type,
+ const char *unit_name,
+ double unit_conv_factor) {
try {
switch (type) {
case PJ_ELLPS2D_LONGITUDE_LATITUDE:
- return PJ_OBJ::create(EllipsoidalCS::createLongitudeLatitude(
- createAngularUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::createLongitudeLatitude(
+ createAngularUnit(unit_name, unit_conv_factor)));
case PJ_ELLPS2D_LATITUDE_LONGITUDE:
- return PJ_OBJ::create(EllipsoidalCS::createLatitudeLongitude(
- createAngularUnit(unit_name, unit_conv_factor)));
+ return pj_obj_create(
+ ctx, EllipsoidalCS::createLatitudeLongitude(
+ createAngularUnit(unit_name, unit_conv_factor)));
}
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
@@ -3275,7 +3309,7 @@ PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
/** \brief Instanciate a ProjectedCRS
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
@@ -3286,32 +3320,32 @@ PJ_OBJ *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
* @param coordinate_system Cartesian coordinate system. Must not be NULL.
*
* @return Object that must be unreferenced with
- * proj_obj_destroy(), or NULL in case of error.
+ * proj_destroy(), or NULL in case of error.
*/
-PJ_OBJ *proj_obj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
- const PJ_OBJ *geodetic_crs,
- const PJ_OBJ *conversion,
- const PJ_OBJ *coordinate_system) {
+PJ *proj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
+ const PJ *geodetic_crs, const PJ *conversion,
+ const PJ *coordinate_system) {
SANITIZE_CTX(ctx);
auto geodCRS =
- util::nn_dynamic_pointer_cast<GeodeticCRS>(geodetic_crs->obj);
+ std::dynamic_pointer_cast<GeodeticCRS>(geodetic_crs->iso_obj);
if (!geodCRS) {
return nullptr;
}
- auto conv = util::nn_dynamic_pointer_cast<Conversion>(conversion->obj);
+ auto conv = std::dynamic_pointer_cast<Conversion>(conversion->iso_obj);
if (!conv) {
return nullptr;
}
auto cs =
- util::nn_dynamic_pointer_cast<CartesianCS>(coordinate_system->obj);
+ std::dynamic_pointer_cast<CartesianCS>(coordinate_system->iso_obj);
if (!cs) {
return nullptr;
}
try {
- return PJ_OBJ::create(ProjectedCRS::create(
- createPropertyMapName(crs_name), NN_NO_CHECK(geodCRS),
- NN_NO_CHECK(conv), NN_NO_CHECK(cs)));
+ return pj_obj_create(
+ ctx, ProjectedCRS::create(createPropertyMapName(crs_name),
+ NN_NO_CHECK(geodCRS), NN_NO_CHECK(conv),
+ NN_NO_CHECK(cs)));
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3322,8 +3356,9 @@ PJ_OBJ *proj_obj_create_projected_crs(PJ_CONTEXT *ctx, const char *crs_name,
//! @cond Doxygen_Suppress
-static PJ_OBJ *proj_obj_create_conversion(const ConversionNNPtr &conv) {
- return PJ_OBJ::create(conv);
+static PJ *proj_create_conversion(PJ_CONTEXT *ctx,
+ const ConversionNNPtr &conv) {
+ return pj_obj_create(ctx, conv);
}
//! @endcond
@@ -3340,11 +3375,11 @@ static PJ_OBJ *proj_obj_create_conversion(const ConversionNNPtr &conv) {
* Linear parameters are expressed in (linear_unit_name,
* linear_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
+PJ *proj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
SANITIZE_CTX(ctx);
try {
auto conv = Conversion::createUTM(PropertyMap(), zone, north != 0);
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3361,7 +3396,7 @@ PJ_OBJ *proj_obj_create_conversion_utm(PJ_CONTEXT *ctx, int zone, int north) {
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
+PJ *proj_create_conversion_transverse_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3377,7 +3412,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3395,7 +3430,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
+PJ *proj_create_conversion_gauss_schreiber_transverse_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3411,7 +3446,7 @@ PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3429,7 +3464,7 @@ PJ_OBJ *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
+PJ *proj_create_conversion_transverse_mercator_south_oriented(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3445,7 +3480,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3462,7 +3497,7 @@ PJ_OBJ *proj_obj_create_conversion_transverse_mercator_south_oriented(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
+PJ *proj_create_conversion_two_point_equidistant(
PJ_CONTEXT *ctx, double latitude_first_point, double longitude_first_point,
double latitude_second_point, double longitude_secon_point,
double false_easting, double false_northing, const char *ang_unit_name,
@@ -3481,7 +3516,7 @@ PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
Angle(longitude_secon_point, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3498,7 +3533,7 @@ PJ_OBJ *proj_obj_create_conversion_two_point_equidistant(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
+PJ *proj_create_conversion_tunisia_mapping_grid(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3513,7 +3548,7 @@ PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3530,7 +3565,7 @@ PJ_OBJ *proj_obj_create_conversion_tunisia_mapping_grid(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
+PJ *proj_create_conversion_albers_equal_area(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3550,7 +3585,7 @@ PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3567,7 +3602,7 @@ PJ_OBJ *proj_obj_create_conversion_albers_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
+PJ *proj_create_conversion_lambert_conic_conformal_1sp(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3583,7 +3618,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3600,7 +3635,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_1sp(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3620,7 +3655,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3638,7 +3673,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp_michigan(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3659,7 +3694,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit),
Scale(ellipsoid_scaling_factor));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3677,7 +3712,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
+PJ *proj_create_conversion_lambert_conic_conformal_2sp_belgium(
PJ_CONTEXT *ctx, double latitude_false_origin,
double longitude_false_origin, double latitude_first_parallel,
double latitude_second_parallel, double easting_false_origin,
@@ -3697,7 +3732,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
Angle(latitude_second_parallel, angUnit),
Length(easting_false_origin, linearUnit),
Length(northing_false_origin, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3714,7 +3749,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
+PJ *proj_create_conversion_azimuthal_equidistant(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3730,7 +3765,7 @@ PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3747,7 +3782,7 @@ PJ_OBJ *proj_obj_create_conversion_azimuthal_equidistant(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_guam_projection(
+PJ *proj_create_conversion_guam_projection(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3763,7 +3798,7 @@ PJ_OBJ *proj_obj_create_conversion_guam_projection(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3780,11 +3815,13 @@ PJ_OBJ *proj_obj_create_conversion_guam_projection(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_bonne(
- PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
- double false_easting, double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_bonne(PJ_CONTEXT *ctx, double latitude_nat_origin,
+ double longitude_nat_origin,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -3796,7 +3833,7 @@ PJ_OBJ *proj_obj_create_conversion_bonne(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3814,7 +3851,7 @@ PJ_OBJ *proj_obj_create_conversion_bonne(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
+PJ *proj_create_conversion_lambert_cylindrical_equal_area_spherical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -3830,7 +3867,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3847,7 +3884,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
+PJ *proj_create_conversion_lambert_cylindrical_equal_area(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -3863,7 +3900,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3880,7 +3917,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_cylindrical_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
+PJ *proj_create_conversion_cassini_soldner(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -3895,7 +3932,7 @@ PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3912,7 +3949,7 @@ PJ_OBJ *proj_obj_create_conversion_cassini_soldner(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
+PJ *proj_create_conversion_equidistant_conic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double latitude_first_parallel, double latitude_second_parallel,
double false_easting, double false_northing, const char *ang_unit_name,
@@ -3931,7 +3968,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
Angle(latitude_second_parallel, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3948,13 +3985,12 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_conic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -3965,7 +4001,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -3982,11 +4018,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_i(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_ii(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_ii(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -3997,7 +4035,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_ii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4014,11 +4052,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_ii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_iii(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_iii(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4029,7 +4069,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4046,11 +4086,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_iv(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_iv(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4061,7 +4103,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iv(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4078,13 +4120,12 @@ PJ_OBJ *proj_obj_create_conversion_eckert_iv(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4095,7 +4136,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4112,11 +4153,13 @@ PJ_OBJ *proj_obj_create_conversion_eckert_v(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_eckert_vi(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_eckert_vi(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4127,7 +4170,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_vi(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4144,7 +4187,7 @@ PJ_OBJ *proj_obj_create_conversion_eckert_vi(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
+PJ *proj_create_conversion_equidistant_cylindrical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -4160,7 +4203,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4178,7 +4221,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
+PJ *proj_create_conversion_equidistant_cylindrical_spherical(
PJ_CONTEXT *ctx, double latitude_first_parallel,
double longitude_nat_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -4194,7 +4237,7 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4211,13 +4254,12 @@ PJ_OBJ *proj_obj_create_conversion_equidistant_cylindrical_spherical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4228,7 +4270,7 @@ PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
Conversion::createGall(PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4245,11 +4287,13 @@ PJ_OBJ *proj_obj_create_conversion_gall(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_goode_homolosine(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4260,7 +4304,7 @@ PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4277,7 +4321,7 @@ PJ_OBJ *proj_obj_create_conversion_goode_homolosine(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
+PJ *proj_create_conversion_interrupted_goode_homolosine(
PJ_CONTEXT *ctx, double center_long, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4292,7 +4336,7 @@ PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4310,7 +4354,7 @@ PJ_OBJ *proj_obj_create_conversion_interrupted_goode_homolosine(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
+PJ *proj_create_conversion_geostationary_satellite_sweep_x(
PJ_CONTEXT *ctx, double center_long, double height, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4325,7 +4369,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
PropertyMap(), Angle(center_long, angUnit),
Length(height, linearUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4343,7 +4387,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_x(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
+PJ *proj_create_conversion_geostationary_satellite_sweep_y(
PJ_CONTEXT *ctx, double center_long, double height, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4358,7 +4402,7 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
PropertyMap(), Angle(center_long, angUnit),
Length(height, linearUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4375,11 +4419,13 @@ PJ_OBJ *proj_obj_create_conversion_geostationary_satellite_sweep_y(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_gnomonic(
- PJ_CONTEXT *ctx, double center_lat, double center_long,
- double false_easting, double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_gnomonic(PJ_CONTEXT *ctx, double center_lat,
+ double center_long, double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4390,7 +4436,7 @@ PJ_OBJ *proj_obj_create_conversion_gnomonic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4408,7 +4454,7 @@ PJ_OBJ *proj_obj_create_conversion_gnomonic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
+PJ *proj_create_conversion_hotine_oblique_mercator_variant_a(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_projection_centre, double azimuth_initial_line,
double angle_from_rectified_to_skrew_grid, double scale,
@@ -4428,7 +4474,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
Angle(angle_from_rectified_to_skrew_grid, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4446,7 +4492,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
+PJ *proj_create_conversion_hotine_oblique_mercator_variant_b(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_projection_centre, double azimuth_initial_line,
double angle_from_rectified_to_skrew_grid, double scale,
@@ -4466,7 +4512,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
Angle(angle_from_rectified_to_skrew_grid, angUnit), Scale(scale),
Length(easting_projection_centre, linearUnit),
Length(northing_projection_centre, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4484,8 +4530,7 @@ PJ_OBJ *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *
-proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
+PJ *proj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
PJ_CONTEXT *ctx, double latitude_projection_centre, double latitude_point1,
double longitude_point1, double latitude_point2, double longitude_point2,
double scale, double easting_projection_centre,
@@ -4507,7 +4552,7 @@ proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
Angle(longitude_point2, angUnit), Scale(scale),
Length(easting_projection_centre, linearUnit),
Length(northing_projection_centre, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4525,7 +4570,7 @@ proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator(
+PJ *proj_create_conversion_laborde_oblique_mercator(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_projection_centre, double azimuth_initial_line,
double scale, double false_easting, double false_northing,
@@ -4543,7 +4588,7 @@ PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator(
Angle(azimuth_initial_line, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4561,7 +4606,7 @@ PJ_OBJ *proj_obj_create_conversion_laborde_oblique_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
+PJ *proj_create_conversion_international_map_world_polyconic(
PJ_CONTEXT *ctx, double center_long, double latitude_first_parallel,
double latitude_second_parallel, double false_easting,
double false_northing, const char *ang_unit_name,
@@ -4579,7 +4624,7 @@ PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
Angle(latitude_second_parallel, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4596,7 +4641,7 @@ PJ_OBJ *proj_obj_create_conversion_international_map_world_polyconic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
+PJ *proj_create_conversion_krovak_north_oriented(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_of_origin, double colatitude_cone_axis,
double latitude_pseudo_standard_parallel,
@@ -4618,7 +4663,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
Scale(scale_factor_pseudo_standard_parallel),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4635,7 +4680,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak_north_oriented(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_krovak(
+PJ *proj_create_conversion_krovak(
PJ_CONTEXT *ctx, double latitude_projection_centre,
double longitude_of_origin, double colatitude_cone_axis,
double latitude_pseudo_standard_parallel,
@@ -4657,7 +4702,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak(
Scale(scale_factor_pseudo_standard_parallel),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4674,7 +4719,7 @@ PJ_OBJ *proj_obj_create_conversion_krovak(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
+PJ *proj_create_conversion_lambert_azimuthal_equal_area(
PJ_CONTEXT *ctx, double latitude_nat_origin, double longitude_nat_origin,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4690,7 +4735,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
Angle(longitude_nat_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4707,7 +4752,7 @@ PJ_OBJ *proj_obj_create_conversion_lambert_azimuthal_equal_area(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
+PJ *proj_create_conversion_miller_cylindrical(
PJ_CONTEXT *ctx, double center_long, double false_easting,
double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4722,7 +4767,7 @@ PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4739,7 +4784,7 @@ PJ_OBJ *proj_obj_create_conversion_miller_cylindrical(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
+PJ *proj_create_conversion_mercator_variant_a(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4755,7 +4800,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4772,7 +4817,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
+PJ *proj_create_conversion_mercator_variant_b(
PJ_CONTEXT *ctx, double latitude_first_parallel, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4787,7 +4832,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
PropertyMap(), Angle(latitude_first_parallel, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4805,7 +4850,7 @@ PJ_OBJ *proj_obj_create_conversion_mercator_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
+PJ *proj_create_conversion_popular_visualisation_pseudo_mercator(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4820,7 +4865,7 @@ PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4837,11 +4882,13 @@ PJ_OBJ *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_mollweide(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_mollweide(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -4852,7 +4899,7 @@ PJ_OBJ *proj_obj_create_conversion_mollweide(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4869,7 +4916,7 @@ PJ_OBJ *proj_obj_create_conversion_mollweide(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
+PJ *proj_create_conversion_new_zealand_mapping_grid(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4884,7 +4931,7 @@ PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4901,7 +4948,7 @@ PJ_OBJ *proj_obj_create_conversion_new_zealand_mapping_grid(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
+PJ *proj_create_conversion_oblique_stereographic(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4917,7 +4964,7 @@ PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4934,7 +4981,7 @@ PJ_OBJ *proj_obj_create_conversion_oblique_stereographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_orthographic(
+PJ *proj_create_conversion_orthographic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4949,7 +4996,7 @@ PJ_OBJ *proj_obj_create_conversion_orthographic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4966,7 +5013,7 @@ PJ_OBJ *proj_obj_create_conversion_orthographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_american_polyconic(
+PJ *proj_create_conversion_american_polyconic(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -4981,7 +5028,7 @@ PJ_OBJ *proj_obj_create_conversion_american_polyconic(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -4998,7 +5045,7 @@ PJ_OBJ *proj_obj_create_conversion_american_polyconic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
+PJ *proj_create_conversion_polar_stereographic_variant_a(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5014,7 +5061,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5031,7 +5078,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_a(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
+PJ *proj_create_conversion_polar_stereographic_variant_b(
PJ_CONTEXT *ctx, double latitude_standard_parallel,
double longitude_of_origin, double false_easting, double false_northing,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -5047,7 +5094,7 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
Angle(longitude_of_origin, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5064,13 +5111,12 @@ PJ_OBJ *proj_obj_create_conversion_polar_stereographic_variant_b(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5081,7 +5127,7 @@ PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5098,11 +5144,13 @@ PJ_OBJ *proj_obj_create_conversion_robinson(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_sinusoidal(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_sinusoidal(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5113,7 +5161,7 @@ PJ_OBJ *proj_obj_create_conversion_sinusoidal(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5130,7 +5178,7 @@ PJ_OBJ *proj_obj_create_conversion_sinusoidal(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_stereographic(
+PJ *proj_create_conversion_stereographic(
PJ_CONTEXT *ctx, double center_lat, double center_long, double scale,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5146,7 +5194,7 @@ PJ_OBJ *proj_obj_create_conversion_stereographic(
Angle(center_long, angUnit), Scale(scale),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5163,11 +5211,13 @@ PJ_OBJ *proj_obj_create_conversion_stereographic(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_van_der_grinten(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5178,7 +5228,7 @@ PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5195,13 +5245,12 @@ PJ_OBJ *proj_obj_create_conversion_van_der_grinten(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5212,7 +5261,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5229,11 +5278,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_i(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_ii(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_ii(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5244,7 +5295,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_ii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5261,7 +5312,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_ii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_iii(
+PJ *proj_create_conversion_wagner_iii(
PJ_CONTEXT *ctx, double latitude_true_scale, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5276,7 +5327,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iii(
PropertyMap(), Angle(latitude_true_scale, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5293,11 +5344,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_iv(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_iv(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5308,7 +5361,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iv(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5325,13 +5378,12 @@ PJ_OBJ *proj_obj_create_conversion_wagner_iv(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
- double false_easting,
- double false_northing,
- const char *ang_unit_name,
- double ang_unit_conv_factor,
- const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
+ double false_easting, double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5342,7 +5394,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5359,11 +5411,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_v(PJ_CONTEXT *ctx, double center_long,
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_vi(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_vi(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5374,7 +5428,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vi(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5391,11 +5445,13 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vi(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_wagner_vii(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_wagner_vii(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5406,7 +5462,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vii(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5424,7 +5480,7 @@ PJ_OBJ *proj_obj_create_conversion_wagner_vii(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
+PJ *proj_create_conversion_quadrilateralized_spherical_cube(
PJ_CONTEXT *ctx, double center_lat, double center_long,
double false_easting, double false_northing, const char *ang_unit_name,
double ang_unit_conv_factor, const char *linear_unit_name,
@@ -5439,7 +5495,7 @@ PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
PropertyMap(), Angle(center_lat, angUnit),
Angle(center_long, angUnit), Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5456,7 +5512,7 @@ PJ_OBJ *proj_obj_create_conversion_quadrilateralized_spherical_cube(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
+PJ *proj_create_conversion_spherical_cross_track_height(
PJ_CONTEXT *ctx, double peg_point_lat, double peg_point_long,
double peg_point_heading, double peg_point_height,
const char *ang_unit_name, double ang_unit_conv_factor,
@@ -5471,7 +5527,7 @@ PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
PropertyMap(), Angle(peg_point_lat, angUnit),
Angle(peg_point_long, angUnit), Angle(peg_point_heading, angUnit),
Length(peg_point_height, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5488,11 +5544,13 @@ PJ_OBJ *proj_obj_create_conversion_spherical_cross_track_height(
* linear_unit_conv_factor).
* Angular parameters are expressed in (ang_unit_name, ang_unit_conv_factor).
*/
-PJ_OBJ *proj_obj_create_conversion_equal_earth(
- PJ_CONTEXT *ctx, double center_long, double false_easting,
- double false_northing, const char *ang_unit_name,
- double ang_unit_conv_factor, const char *linear_unit_name,
- double linear_unit_conv_factor) {
+PJ *proj_create_conversion_equal_earth(PJ_CONTEXT *ctx, double center_long,
+ double false_easting,
+ double false_northing,
+ const char *ang_unit_name,
+ double ang_unit_conv_factor,
+ const char *linear_unit_name,
+ double linear_unit_conv_factor) {
SANITIZE_CTX(ctx);
try {
UnitOfMeasure linearUnit(
@@ -5503,7 +5561,7 @@ PJ_OBJ *proj_obj_create_conversion_equal_earth(
PropertyMap(), Angle(center_long, angUnit),
Length(false_easting, linearUnit),
Length(false_northing, linearUnit));
- return proj_obj_create_conversion(conv);
+ return proj_create_conversion(ctx, conv);
} catch (const std::exception &e) {
proj_log_error(ctx, __FUNCTION__, e.what());
}
@@ -5524,10 +5582,10 @@ PJ_OBJ *proj_obj_create_conversion_equal_earth(
*/
int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
assert(coordoperation);
- auto op =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto op = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -5551,10 +5609,11 @@ int proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return 0;
@@ -5574,12 +5633,13 @@ int proj_coordoperation_get_param_count(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param_index(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char *name) {
SANITIZE_CTX(ctx);
assert(coordoperation);
assert(name);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return -1;
@@ -5628,15 +5688,15 @@ int proj_coordoperation_get_param_index(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_param(
- PJ_CONTEXT *ctx, const PJ_OBJ *coordoperation, int index,
- const char **out_name, const char **out_auth_name, const char **out_code,
- double *out_value, const char **out_value_string,
- double *out_unit_conv_factor, const char **out_unit_name,
- const char **out_unit_auth_name, const char **out_unit_code,
- const char **out_unit_category) {
+ PJ_CONTEXT *ctx, const PJ *coordoperation, int index, const char **out_name,
+ const char **out_auth_name, const char **out_code, double *out_value,
+ const char **out_value_string, double *out_unit_conv_factor,
+ const char **out_unit_name, const char **out_unit_auth_name,
+ const char **out_unit_code, const char **out_unit_category) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto op = dynamic_cast<const SingleOperation *>(coordoperation->obj.get());
+ auto op =
+ dynamic_cast<const SingleOperation *>(coordoperation->iso_obj.get());
if (!op) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleOperation");
return false;
@@ -5751,13 +5811,13 @@ int proj_coordoperation_get_param(
*/
int proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
double *out_values, int value_count,
int emit_error_if_incompatible) {
SANITIZE_CTX(ctx);
assert(coordoperation);
auto transf =
- dynamic_cast<const Transformation *>(coordoperation->obj.get());
+ dynamic_cast<const Transformation *>(coordoperation->iso_obj.get());
if (!transf) {
if (emit_error_if_incompatible) {
proj_log_error(ctx, __FUNCTION__, "Object is not a Transformation");
@@ -5789,11 +5849,11 @@ int proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto co =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto co = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!co) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -5842,7 +5902,7 @@ int proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx,
*/
int proj_coordoperation_get_grid_used(
- PJ_CONTEXT *ctx, const PJ_OBJ *coordoperation, int index,
+ PJ_CONTEXT *ctx, const PJ *coordoperation, int index,
const char **out_short_name, const char **out_full_name,
const char **out_package_name, const char **out_url,
int *out_direct_download, int *out_open_license, int *out_available) {
@@ -6239,22 +6299,23 @@ void proj_operation_factory_context_set_allowed_intermediate_crs(
* @param target_crs source CRS. Must not be NULL.
* @param operationContext Search context. Must not be NULL.
* @return a result set that must be unreferenced with
- * proj_obj_list_destroy(), or NULL in case of error.
+ * proj_list_destroy(), or NULL in case of error.
*/
-PJ_OBJ_LIST *proj_obj_create_operations(
- PJ_CONTEXT *ctx, const PJ_OBJ *source_crs, const PJ_OBJ *target_crs,
- const PJ_OPERATION_FACTORY_CONTEXT *operationContext) {
+PJ_OBJ_LIST *
+proj_create_operations(PJ_CONTEXT *ctx, const PJ *source_crs,
+ const PJ *target_crs,
+ const PJ_OPERATION_FACTORY_CONTEXT *operationContext) {
SANITIZE_CTX(ctx);
assert(source_crs);
assert(target_crs);
assert(operationContext);
- auto sourceCRS = nn_dynamic_pointer_cast<CRS>(source_crs->obj);
+ auto sourceCRS = std::dynamic_pointer_cast<CRS>(source_crs->iso_obj);
if (!sourceCRS) {
proj_log_error(ctx, __FUNCTION__, "source_crs is not a CRS");
return nullptr;
}
- auto targetCRS = nn_dynamic_pointer_cast<CRS>(target_crs->obj);
+ auto targetCRS = std::dynamic_pointer_cast<CRS>(target_crs->iso_obj);
if (!targetCRS) {
proj_log_error(ctx, __FUNCTION__, "target_crs is not a CRS");
return nullptr;
@@ -6282,7 +6343,7 @@ PJ_OBJ_LIST *proj_obj_create_operations(
*
* @param result Objet of type PJ_OBJ_LIST (must not be NULL)
*/
-int proj_obj_list_get_count(const PJ_OBJ_LIST *result) {
+int proj_list_get_count(const PJ_OBJ_LIST *result) {
assert(result);
return static_cast<int>(result->objects.size());
}
@@ -6291,26 +6352,25 @@ int proj_obj_list_get_count(const PJ_OBJ_LIST *result) {
/** \brief Return an object from the result set
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param result Objet of type PJ_OBJ_LIST (must not be NULL)
* @param index Index
- * @return a new object that must be unreferenced with proj_obj_destroy(),
+ * @return a new object that must be unreferenced with proj_destroy(),
* or nullptr in case of error.
*/
-PJ_OBJ *proj_obj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result,
- int index) {
+PJ *proj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result, int index) {
SANITIZE_CTX(ctx);
assert(result);
- if (index < 0 || index >= proj_obj_list_get_count(result)) {
+ if (index < 0 || index >= proj_list_get_count(result)) {
proj_log_error(ctx, __FUNCTION__, "Invalid index");
return nullptr;
}
- return PJ_OBJ::create(result->objects[index]);
+ return pj_obj_create(ctx, result->objects[index]);
}
// ---------------------------------------------------------------------------
@@ -6322,7 +6382,7 @@ PJ_OBJ *proj_obj_list_get(PJ_CONTEXT *ctx, const PJ_OBJ_LIST *result,
*
* @param result Object, or NULL.
*/
-void proj_obj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
+void proj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
// ---------------------------------------------------------------------------
@@ -6333,11 +6393,11 @@ void proj_obj_list_destroy(PJ_OBJ_LIST *result) { delete result; }
* @return the accuracy, or a negative value if unknown or in case of error.
*/
double proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation) {
+ const PJ *coordoperation) {
SANITIZE_CTX(ctx);
assert(coordoperation);
- auto co =
- dynamic_cast<const CoordinateOperation *>(coordoperation->obj.get());
+ auto co = dynamic_cast<const CoordinateOperation *>(
+ coordoperation->iso_obj.get());
if (!co) {
proj_log_error(ctx, __FUNCTION__,
"Object is not a CoordinateOperation");
@@ -6358,19 +6418,19 @@ double proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx,
/** \brief Returns the datum of a SingleCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type SingleCRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error (or if there is no datum)
*/
-PJ_OBJ *proj_obj_crs_get_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_datum(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const SingleCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const SingleCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleCRS");
return nullptr;
@@ -6379,31 +6439,31 @@ PJ_OBJ *proj_obj_crs_get_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
if (!datum) {
return nullptr;
}
- return PJ_OBJ::create(NN_NO_CHECK(datum));
+ return pj_obj_create(ctx, NN_NO_CHECK(datum));
}
// ---------------------------------------------------------------------------
/** \brief Returns the coordinate system of a SingleCRS.
*
- * The returned object must be unreferenced with proj_obj_destroy() after
+ * The returned object must be unreferenced with proj_destroy() after
* use.
* It should be used by at most one thread at a time.
*
* @param ctx PROJ context, or NULL for default context
* @param crs Objet of type SingleCRS (must not be NULL)
- * @return Object that must be unreferenced with proj_obj_destroy(), or NULL
+ * @return Object that must be unreferenced with proj_destroy(), or NULL
* in case of error.
*/
-PJ_OBJ *proj_obj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
+PJ *proj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ *crs) {
SANITIZE_CTX(ctx);
assert(crs);
- auto l_crs = dynamic_cast<const SingleCRS *>(crs->obj.get());
+ auto l_crs = dynamic_cast<const SingleCRS *>(crs->iso_obj.get());
if (!l_crs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a SingleCRS");
return nullptr;
}
- return PJ_OBJ::create(l_crs->coordinateSystem());
+ return pj_obj_create(ctx, l_crs->coordinateSystem());
}
// ---------------------------------------------------------------------------
@@ -6414,11 +6474,10 @@ PJ_OBJ *proj_obj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ_OBJ *crs) {
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @return type, or PJ_CS_TYPE_UNKNOWN in case of error.
*/
-PJ_COORDINATE_SYSTEM_TYPE proj_obj_cs_get_type(PJ_CONTEXT *ctx,
- const PJ_OBJ *cs) {
+PJ_COORDINATE_SYSTEM_TYPE proj_cs_get_type(PJ_CONTEXT *ctx, const PJ *cs) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return PJ_CS_TYPE_UNKNOWN;
@@ -6461,10 +6520,10 @@ PJ_COORDINATE_SYSTEM_TYPE proj_obj_cs_get_type(PJ_CONTEXT *ctx,
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @return number of axis, or -1 in case of error.
*/
-int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
+int proj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ *cs) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return -1;
@@ -6479,7 +6538,7 @@ int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
* @param ctx PROJ context, or NULL for default context
* @param cs Objet of type CoordinateSystem (must not be NULL)
* @param index Index of the coordinate system (between 0 and
- * proj_obj_cs_get_axis_count() - 1)
+ * proj_cs_get_axis_count() - 1)
* @param out_name Pointer to a string value to store the axis name. or NULL
* @param out_abbrev Pointer to a string value to store the axis abbreviation.
* or NULL
@@ -6495,16 +6554,16 @@ int proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx, const PJ_OBJ *cs) {
* unit code. or NULL
* @return TRUE in case of success
*/
-int proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ_OBJ *cs, int index,
- const char **out_name, const char **out_abbrev,
- const char **out_direction,
- double *out_unit_conv_factor,
- const char **out_unit_name,
- const char **out_unit_auth_name,
- const char **out_unit_code) {
+int proj_cs_get_axis_info(PJ_CONTEXT *ctx, const PJ *cs, int index,
+ const char **out_name, const char **out_abbrev,
+ const char **out_direction,
+ double *out_unit_conv_factor,
+ const char **out_unit_name,
+ const char **out_unit_auth_name,
+ const char **out_unit_code) {
SANITIZE_CTX(ctx);
assert(cs);
- auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->obj.get());
+ auto l_cs = dynamic_cast<const CoordinateSystem *>(cs->iso_obj.get());
if (!l_cs) {
proj_log_error(ctx, __FUNCTION__, "Object is not a CoordinateSystem");
return false;
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index e9a9f434..93314b85 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -41,7 +41,11 @@
#include "proj/internal/internal.hpp"
#include "proj/internal/io_internal.hpp"
-#include "projects.h" // M_PI
+// PROJ include order is sensitive
+// clang-format off
+#include "proj.h"
+#include "proj_internal.h" // M_PI
+// clang-format on
#include <algorithm>
#include <cassert>
diff --git a/src/iso19111/datum.cpp b/src/iso19111/datum.cpp
index 16e86296..320be14b 100644
--- a/src/iso19111/datum.cpp
+++ b/src/iso19111/datum.cpp
@@ -42,7 +42,7 @@
// PROJ include order is sensitive
// clang-format off
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_api.h"
// clang-format on
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 47d31db9..8dac7be7 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -59,7 +59,8 @@
// PROJ include order is sensitive
// clang-format off
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
+#include "proj_api.h"
// clang-format on
#include <sqlite3.h>
diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp
index effb3968..15a069c6 100644
--- a/src/iso19111/io.cpp
+++ b/src/iso19111/io.cpp
@@ -66,7 +66,7 @@
// PROJ include order is sensitive
// clang-format off
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_api.h"
// clang-format on
diff --git a/src/jniproj.cpp b/src/jniproj.cpp
index e6f83270..59b5b2a0 100644
--- a/src/jniproj.cpp
+++ b/src/jniproj.cpp
@@ -48,7 +48,7 @@
#include <math.h>
#include <string.h>
-#include "projects.h"
+#include "proj_internal.h"
#include "org_proj4_PJ.h"
#include <jni.h>
diff --git a/src/lib_proj.cmake b/src/lib_proj.cmake
index 767106e6..b595d87e 100644
--- a/src/lib_proj.cmake
+++ b/src/lib_proj.cmake
@@ -200,7 +200,7 @@ SET(SRC_LIBPROJ_ISO19111
)
SET(SRC_LIBPROJ_CORE
- pj_list.h proj_internal.h proj_math.h projects.h
+ pj_list.h proj_internal.h proj_math.h
aasincos.cpp adjlon.cpp bch2bps.cpp bchgen.cpp
biveval.cpp dmstor.cpp mk_cheby.cpp auth.cpp
deriv.cpp ell_set.cpp ellps.cpp errno.cpp
diff --git a/src/list.cpp b/src/list.cpp
index 73ca5f86..360d6b66 100644
--- a/src/list.cpp
+++ b/src/list.cpp
@@ -5,7 +5,7 @@
#include "proj.h"
#define USE_PJ_LIST_H 1
-#include "projects.h"
+#include "proj_internal.h"
/* Generate prototypes for projection functions */
diff --git a/src/log.cpp b/src/log.cpp
index 0f81dc13..4c15772b 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -31,7 +31,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
/************************************************************************/
/* pj_stderr_logger() */
diff --git a/src/malloc.cpp b/src/malloc.cpp
index c8681570..6bd4639e 100644
--- a/src/malloc.cpp
+++ b/src/malloc.cpp
@@ -44,8 +44,10 @@
#include <stdlib.h>
#include <string.h>
+#include <new>
+
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
/**********************************************************************/
void *pj_malloc(size_t size) {
@@ -178,7 +180,7 @@ void *pj_dealloc_params (PJ_CONTEXT *ctx, paralist *start, int errlev) {
/************************************************************************/
void pj_free(PJ *P) {
- if (nullptr==P)
+ if (nullptr==P || !P->destructor)
return;
/* free projection parameters - all the hard work is done by */
/* pj_default_destructor, which is supposed */
@@ -188,7 +190,16 @@ void pj_free(PJ *P) {
P->destructor (P, proj_errno(P));
}
+/*****************************************************************************/
+// cppcheck-suppress uninitMemberVar
+PJconsts::PJconsts(): destructor(pj_default_destructor) {}
+/*****************************************************************************/
+/*****************************************************************************/
+PJ *pj_new() {
+/*****************************************************************************/
+ return new(std::nothrow) PJ();
+}
/*****************************************************************************/
@@ -235,6 +246,6 @@ PJ *pj_default_destructor (PJ *P, int errlev) { /* Destructor */
pj_free (P->vgridshift);
pj_dealloc (static_cast<struct pj_opaque*>(P->opaque));
- pj_dealloc(P);
+ delete P;
return nullptr;
}
diff --git a/src/mk_cheby.cpp b/src/mk_cheby.cpp
index 5e6bfef0..0f3b97ed 100644
--- a/src/mk_cheby.cpp
+++ b/src/mk_cheby.cpp
@@ -1,9 +1,10 @@
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static void /* sum coefficients less than res */
-eval(projUV **w, int nu, int nv, double res, projUV *resid) {
+eval(PJ_UV **w, int nu, int nv, double res, PJ_UV *resid) {
int i, j;
double ab;
- projUV *s;
+ PJ_UV *s;
resid->u = resid->v = 0.;
for (i = 0; i < nu; ++i) {
@@ -41,14 +42,14 @@ makeT(int nru, int nrv) {
return T;
}
Tseries *
-mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
+mk_cheby(PJ_UV a, PJ_UV b, double res, PJ_UV *resid, PJ_UV (*func)(PJ_UV),
int nu, int nv, int power) {
int j, i, nru, nrv, *ncu, *ncv;
Tseries *T = nullptr;
- projUV **w;
+ PJ_UV **w;
double cutres;
- if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))))
+ if (!(w = (PJ_UV **)vector2(nu, nv, sizeof(PJ_UV))))
return nullptr;
if (!(ncu = (int *)vector1(nu + nv, sizeof(int)))) {
freev2((void **)w, nu);
@@ -56,7 +57,7 @@ mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
}
ncv = ncu + nu;
if (!bchgen(a, b, nu, nv, w, func)) {
- projUV *s;
+ PJ_UV *s;
double ab, *p;
/* analyse coefficients and adjust until residual OK */
diff --git a/src/mlfn.cpp b/src/mlfn.cpp
index e032e642..a5448e3b 100644
--- a/src/mlfn.cpp
+++ b/src/mlfn.cpp
@@ -1,6 +1,7 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* meridional distance for ellipsoid and inverse
** 8th degree - accurate to < 1e-5 meters when used in conjunction
diff --git a/src/msfn.cpp b/src/msfn.cpp
index 999e73a7..74506317 100644
--- a/src/msfn.cpp
+++ b/src/msfn.cpp
@@ -1,6 +1,7 @@
/* determine constant small m */
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
double
pj_msfn(double sinphi, double cosphi, double es) {
return (cosphi / sqrt (1. - es * sinphi * sinphi));
diff --git a/src/mutex.cpp b/src/mutex.cpp
index 3752324c..12251f0f 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -38,9 +38,10 @@
#define _GNU_SOURCE
#endif
+#include "proj.h"
#ifndef _WIN32
#include "proj_config.h"
-#include "projects.h"
+#include "proj_internal.h"
#else
#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
diff --git a/src/nad_cvt.cpp b/src/nad_cvt.cpp
index ec4a2b47..76d2ccd0 100644
--- a/src/nad_cvt.cpp
+++ b/src/nad_cvt.cpp
@@ -3,14 +3,15 @@
#include <stdio.h>
#include <stdlib.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_math.h"
#define MAX_ITERATIONS 10
#define TOL 1e-12
-LP nad_cvt(LP in, int inverse, struct CTABLE *ct) {
- LP t, tb,del, dif;
+PJ_LP nad_cvt(PJ_LP in, int inverse, struct CTABLE *ct) {
+ PJ_LP t, tb,del, dif;
int i = MAX_ITERATIONS;
const double toltol = TOL*TOL;
diff --git a/src/nad_init.cpp b/src/nad_init.cpp
index 1e2b150d..d9701e70 100644
--- a/src/nad_init.cpp
+++ b/src/nad_init.cpp
@@ -33,7 +33,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/************************************************************************/
/* swap_words() */
@@ -73,9 +74,10 @@ static void swap_words( void *data_in, int word_size, int word_count )
/* Load the data portion of a ctable formatted grid. */
/************************************************************************/
-int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
+int nad_ctable_load( projCtx ctx, struct CTABLE *ct, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
size_t a_size;
pj_ctx_fseek( ctx, fid, sizeof(struct CTABLE), SEEK_SET );
@@ -104,8 +106,9 @@ int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
/* Read the header portion of a "ctable" format grid. */
/************************************************************************/
-struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
+struct CTABLE *nad_ctable_init( projCtx ctx, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
struct CTABLE *ct;
int id_end;
@@ -148,9 +151,10 @@ struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
/* Load the data portion of a ctable2 formatted grid. */
/************************************************************************/
-int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
+int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
size_t a_size;
pj_ctx_fseek( ctx, fid, 160, SEEK_SET );
@@ -188,8 +192,9 @@ int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
/* Read the header portion of a "ctable2" format grid. */
/************************************************************************/
-struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
+struct CTABLE *nad_ctable2_init( projCtx ctx, struct projFileAPI_t* fileapi )
{
+ PAFile fid = (PAFile)fileapi;
struct CTABLE *ct;
int id_end;
char header[160];
@@ -274,10 +279,10 @@ struct CTABLE *nad_init(projCtx ctx, char *name)
return nullptr;
}
- ct = nad_ctable_init( ctx, fid );
+ ct = nad_ctable_init( ctx, (struct projFileAPI_t*)fid );
if( ct != nullptr )
{
- if( !nad_ctable_load( ctx, ct, fid ) )
+ if( !nad_ctable_load( ctx, ct, (struct projFileAPI_t*)fid ) )
{
nad_free( ct );
ct = nullptr;
diff --git a/src/nad_intr.cpp b/src/nad_intr.cpp
index 1f9d1e0c..2c301ef8 100644
--- a/src/nad_intr.cpp
+++ b/src/nad_intr.cpp
@@ -2,11 +2,11 @@
#define PJ_LIB__
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
- LP
-nad_intr(LP t, struct CTABLE *ct) {
- LP val, frct;
+PJ_LP nad_intr(PJ_LP t, struct CTABLE *ct) {
+ PJ_LP val, frct;
ILP indx;
double m00, m10, m01, m11;
FLP *f00, *f10, *f01, *f11;
diff --git a/src/open_lib.cpp b/src/open_lib.cpp
index c75b4af6..f4fa313f 100644
--- a/src/open_lib.cpp
+++ b/src/open_lib.cpp
@@ -37,7 +37,7 @@
#include <string.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
static const char *(*pj_finder)(const char *) = nullptr;
static int path_count = 0;
diff --git a/src/param.cpp b/src/param.cpp
index 74247b72..8125d62f 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -6,7 +6,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* create parameter list entry */
paralist *pj_mkparam(const char *str) {
diff --git a/src/phi2.cpp b/src/phi2.cpp
index a83302e6..afabd06e 100644
--- a/src/phi2.cpp
+++ b/src/phi2.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
static const double TOL = 1.0e-10;
static const int N_ITER = 15;
diff --git a/src/pipeline.cpp b/src/pipeline.cpp
index 76fc58a5..4b4ba3a7 100644
--- a/src/pipeline.cpp
+++ b/src/pipeline.cpp
@@ -104,7 +104,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-20
#include "geodesic.h"
#include "proj.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(pipeline, "Transformation pipeline manager");
@@ -122,10 +122,10 @@ struct pj_opaque {
static PJ_COORD pipeline_forward_4d (PJ_COORD point, PJ *P);
static PJ_COORD pipeline_reverse_4d (PJ_COORD point, PJ *P);
-static XYZ pipeline_forward_3d (LPZ lpz, PJ *P);
-static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P);
-static XY pipeline_forward (LP lp, PJ *P);
-static LP pipeline_reverse (XY xy, PJ *P);
+static PJ_XYZ pipeline_forward_3d (PJ_LPZ lpz, PJ *P);
+static PJ_LPZ pipeline_reverse_3d (PJ_XYZ xyz, PJ *P);
+static PJ_XY pipeline_forward (PJ_LP lp, PJ *P);
+static PJ_LP pipeline_reverse (PJ_XY xy, PJ *P);
@@ -158,7 +158,7 @@ static PJ_COORD pipeline_reverse_4d (PJ_COORD point, PJ *P) {
-static XYZ pipeline_forward_3d (LPZ lpz, PJ *P) {
+static PJ_XYZ pipeline_forward_3d (PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.lpz = lpz;
@@ -170,7 +170,7 @@ static XYZ pipeline_forward_3d (LPZ lpz, PJ *P) {
}
-static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P) {
+static PJ_LPZ pipeline_reverse_3d (PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.xyz = xyz;
@@ -184,7 +184,7 @@ static LPZ pipeline_reverse_3d (XYZ xyz, PJ *P) {
-static XY pipeline_forward (LP lp, PJ *P) {
+static PJ_XY pipeline_forward (PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.lp = lp;
@@ -196,7 +196,7 @@ static XY pipeline_forward (LP lp, PJ *P) {
}
-static LP pipeline_reverse (XY xy, PJ *P) {
+static PJ_LP pipeline_reverse (PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
int i;
point.xy = xy;
diff --git a/src/pr_list.cpp b/src/pr_list.cpp
index b8ad2c04..77db5bfb 100644
--- a/src/pr_list.cpp
+++ b/src/pr_list.cpp
@@ -4,7 +4,8 @@
#include <stdio.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#define LINE_LEN 72
static int
diff --git a/src/proj.h b/src/proj.h
index 8ec48088..a6ab1c92 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -113,12 +113,11 @@
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
-#include <stddef.h> /* For size_t */
+#ifndef PROJ_H
+#define PROJ_H
+#include <stddef.h> /* For size_t */
-#ifdef PROJECTS_H
-#error proj.h must be included before projects.h
-#endif
#ifdef PROJ_API_H
#error proj.h must be included before proj_api.h
#endif
@@ -127,8 +126,6 @@
#include "proj_symbol_rename.h"
#endif
-#ifndef PROJ_H
-#define PROJ_H
#ifdef __cplusplus
extern "C" {
#endif
@@ -453,10 +450,6 @@ char PROJ_DLL * proj_rtodms(char *s, double r, int pos, int neg);
*/
/*! @cond Doxygen_Suppress */
-typedef struct PJ_OBJ PJ_OBJ;
-/*! @endcond */
-
-/*! @cond Doxygen_Suppress */
typedef struct PJ_OBJ_LIST PJ_OBJ_LIST;
/*! @endcond */
@@ -498,33 +491,33 @@ typedef enum
PJ_GUESSED_WKT_DIALECT PROJ_DLL proj_context_guess_wkt_dialect(PJ_CONTEXT *ctx,
const char *wkt);
-PJ_OBJ PROJ_DLL *proj_obj_create_from_user_input(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_from_user_input(PJ_CONTEXT *ctx,
const char *text,
const char* const *options);
-PJ_OBJ PROJ_DLL *proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
+PJ PROJ_DLL *proj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt,
const char* const *options,
PROJ_STRING_LIST *out_warnings,
PROJ_STRING_LIST *out_grammar_errors);
-PJ_OBJ PROJ_DLL *proj_obj_create_from_proj_string(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_from_proj_string(PJ_CONTEXT *ctx,
const char *proj_string,
const char* const *options);
/** \brief Object category. */
typedef enum
{
- PJ_OBJ_CATEGORY_ELLIPSOID,
- PJ_OBJ_CATEGORY_PRIME_MERIDIAN,
- PJ_OBJ_CATEGORY_DATUM,
- PJ_OBJ_CATEGORY_CRS,
- PJ_OBJ_CATEGORY_COORDINATE_OPERATION
-} PJ_OBJ_CATEGORY;
-
-PJ_OBJ PROJ_DLL *proj_obj_create_from_database(PJ_CONTEXT *ctx,
+ PJ_CATEGORY_ELLIPSOID,
+ PJ_CATEGORY_PRIME_MERIDIAN,
+ PJ_CATEGORY_DATUM,
+ PJ_CATEGORY_CRS,
+ PJ_CATEGORY_COORDINATE_OPERATION
+} PJ_CATEGORY;
+
+PJ PROJ_DLL *proj_create_from_database(PJ_CONTEXT *ctx,
const char *auth_name,
const char *code,
- PJ_OBJ_CATEGORY category,
+ PJ_CATEGORY category,
int usePROJAlternativeGridNames,
const char* const *options);
@@ -535,66 +528,64 @@ int PROJ_DLL proj_uom_get_info_from_database(PJ_CONTEXT *ctx,
double *out_conv_factor,
const char **out_category);
-void PROJ_DLL proj_obj_destroy(PJ_OBJ *obj);
-
-PJ_OBJ PROJ_DLL *proj_obj_clone(PJ_CONTEXT *ctx, const PJ_OBJ *obj);
+PJ PROJ_DLL *proj_clone(PJ_CONTEXT *ctx, const PJ *obj);
/** \brief Object type. */
typedef enum
{
- PJ_OBJ_TYPE_UNKNOWN,
+ PJ_TYPE_UNKNOWN,
- PJ_OBJ_TYPE_ELLIPSOID,
+ PJ_TYPE_ELLIPSOID,
- PJ_OBJ_TYPE_PRIME_MERIDIAN,
+ PJ_TYPE_PRIME_MERIDIAN,
- PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME,
- PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
- PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME,
- PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
- PJ_OBJ_TYPE_DATUM_ENSEMBLE,
+ PJ_TYPE_GEODETIC_REFERENCE_FRAME,
+ PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
+ PJ_TYPE_VERTICAL_REFERENCE_FRAME,
+ PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
+ PJ_TYPE_DATUM_ENSEMBLE,
- /** Abstract type, not returned by proj_obj_get_type() */
- PJ_OBJ_TYPE_CRS,
+ /** Abstract type, not returned by proj_get_type() */
+ PJ_TYPE_CRS,
- PJ_OBJ_TYPE_GEODETIC_CRS,
- PJ_OBJ_TYPE_GEOCENTRIC_CRS,
+ PJ_TYPE_GEODETIC_CRS,
+ PJ_TYPE_GEOCENTRIC_CRS,
- /** proj_obj_get_type() will never return that type, but
- * PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS or PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS. */
- PJ_OBJ_TYPE_GEOGRAPHIC_CRS,
+ /** proj_get_type() will never return that type, but
+ * PJ_TYPE_GEOGRAPHIC_2D_CRS or PJ_TYPE_GEOGRAPHIC_3D_CRS. */
+ PJ_TYPE_GEOGRAPHIC_CRS,
- PJ_OBJ_TYPE_GEOGRAPHIC_2D_CRS,
- PJ_OBJ_TYPE_GEOGRAPHIC_3D_CRS,
- PJ_OBJ_TYPE_VERTICAL_CRS,
- PJ_OBJ_TYPE_PROJECTED_CRS,
- PJ_OBJ_TYPE_COMPOUND_CRS,
- PJ_OBJ_TYPE_TEMPORAL_CRS,
- PJ_OBJ_TYPE_ENGINEERING_CRS,
- PJ_OBJ_TYPE_BOUND_CRS,
- PJ_OBJ_TYPE_OTHER_CRS,
+ PJ_TYPE_GEOGRAPHIC_2D_CRS,
+ PJ_TYPE_GEOGRAPHIC_3D_CRS,
+ PJ_TYPE_VERTICAL_CRS,
+ PJ_TYPE_PROJECTED_CRS,
+ PJ_TYPE_COMPOUND_CRS,
+ PJ_TYPE_TEMPORAL_CRS,
+ PJ_TYPE_ENGINEERING_CRS,
+ PJ_TYPE_BOUND_CRS,
+ PJ_TYPE_OTHER_CRS,
- PJ_OBJ_TYPE_CONVERSION,
- PJ_OBJ_TYPE_TRANSFORMATION,
- PJ_OBJ_TYPE_CONCATENATED_OPERATION,
- PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION,
-} PJ_OBJ_TYPE;
+ PJ_TYPE_CONVERSION,
+ PJ_TYPE_TRANSFORMATION,
+ PJ_TYPE_CONCATENATED_OPERATION,
+ PJ_TYPE_OTHER_COORDINATE_OPERATION,
+} PJ_TYPE;
-PJ_OBJ_LIST PROJ_DLL *proj_obj_create_from_name(PJ_CONTEXT *ctx,
+PJ_OBJ_LIST PROJ_DLL *proj_create_from_name(PJ_CONTEXT *ctx,
const char *auth_name,
const char *searchedName,
- const PJ_OBJ_TYPE* types,
+ const PJ_TYPE* types,
size_t typesCount,
int approximateMatch,
size_t limitResultCount,
const char* const *options);
-PJ_OBJ_TYPE PROJ_DLL proj_obj_get_type(const PJ_OBJ *obj);
+PJ_TYPE PROJ_DLL proj_get_type(const PJ *obj);
-int PROJ_DLL proj_obj_is_deprecated(const PJ_OBJ *obj);
+int PROJ_DLL proj_is_deprecated(const PJ *obj);
-PJ_OBJ_LIST PROJ_DLL *proj_obj_get_non_deprecated(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj);
+PJ_OBJ_LIST PROJ_DLL *proj_get_non_deprecated(PJ_CONTEXT *ctx,
+ const PJ *obj);
/** Comparison criterion. */
typedef enum
@@ -618,19 +609,19 @@ typedef enum
PJ_COMP_EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS,
} PJ_COMPARISON_CRITERION;
-int PROJ_DLL proj_obj_is_equivalent_to(const PJ_OBJ *obj, const PJ_OBJ* other,
+int PROJ_DLL proj_is_equivalent_to(const PJ *obj, const PJ *other,
PJ_COMPARISON_CRITERION criterion);
-int PROJ_DLL proj_obj_is_crs(const PJ_OBJ *obj);
+int PROJ_DLL proj_is_crs(const PJ *obj);
-const char PROJ_DLL* proj_obj_get_name(const PJ_OBJ *obj);
+const char PROJ_DLL* proj_get_name(const PJ *obj);
-const char PROJ_DLL* proj_obj_get_id_auth_name(const PJ_OBJ *obj, int index);
+const char PROJ_DLL* proj_get_id_auth_name(const PJ *obj, int index);
-const char PROJ_DLL* proj_obj_get_id_code(const PJ_OBJ *obj, int index);
+const char PROJ_DLL* proj_get_id_code(const PJ *obj, int index);
-int PROJ_DLL proj_obj_get_area_of_use(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj,
+int PROJ_DLL proj_get_area_of_use(PJ_CONTEXT *ctx,
+ const PJ *obj,
double* out_west_lon_degree,
double* out_south_lat_degree,
double* out_east_lon_degree,
@@ -654,8 +645,8 @@ typedef enum
PJ_WKT1_ESRI
} PJ_WKT_TYPE;
-const char PROJ_DLL* proj_obj_as_wkt(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj, PJ_WKT_TYPE type,
+const char PROJ_DLL* proj_as_wkt(PJ_CONTEXT *ctx,
+ const PJ *obj, PJ_WKT_TYPE type,
const char* const *options);
/** \brief PROJ string version. */
@@ -667,19 +658,19 @@ typedef enum
PJ_PROJ_4
} PJ_PROJ_STRING_TYPE;
-const char PROJ_DLL* proj_obj_as_proj_string(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj,
+const char PROJ_DLL* proj_as_proj_string(PJ_CONTEXT *ctx,
+ const PJ *obj,
PJ_PROJ_STRING_TYPE type,
const char* const *options);
-PJ_OBJ PROJ_DLL *proj_obj_get_source_crs(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj);
+PJ PROJ_DLL *proj_get_source_crs(PJ_CONTEXT *ctx,
+ const PJ *obj);
-PJ_OBJ PROJ_DLL *proj_obj_get_target_crs(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj);
+PJ PROJ_DLL *proj_get_target_crs(PJ_CONTEXT *ctx,
+ const PJ *obj);
-PJ_OBJ_LIST PROJ_DLL *proj_obj_identify(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
+PJ_OBJ_LIST PROJ_DLL *proj_identify(PJ_CONTEXT *ctx,
+ const PJ *obj,
const char *auth_name,
const char* const *options,
int **out_confidence);
@@ -692,7 +683,7 @@ PROJ_STRING_LIST PROJ_DLL proj_get_authorities_from_database(PJ_CONTEXT *ctx);
PROJ_STRING_LIST PROJ_DLL proj_get_codes_from_database(PJ_CONTEXT *ctx,
const char *auth_name,
- PJ_OBJ_TYPE type,
+ PJ_TYPE type,
int allow_deprecated);
/* ------------------------------------------------------------------------- */
@@ -800,31 +791,31 @@ void PROJ_DLL proj_operation_factory_context_set_allowed_intermediate_crs(
/* ------------------------------------------------------------------------- */
-PJ_OBJ_LIST PROJ_DLL *proj_obj_create_operations(
+PJ_OBJ_LIST PROJ_DLL *proj_create_operations(
PJ_CONTEXT *ctx,
- const PJ_OBJ *source_crs,
- const PJ_OBJ *target_crs,
+ const PJ *source_crs,
+ const PJ *target_crs,
const PJ_OPERATION_FACTORY_CONTEXT *operationContext);
-int PROJ_DLL proj_obj_list_get_count(const PJ_OBJ_LIST *result);
+int PROJ_DLL proj_list_get_count(const PJ_OBJ_LIST *result);
-PJ_OBJ PROJ_DLL *proj_obj_list_get(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_list_get(PJ_CONTEXT *ctx,
const PJ_OBJ_LIST *result,
int index);
-void PROJ_DLL proj_obj_list_destroy(PJ_OBJ_LIST *result);
+void PROJ_DLL proj_list_destroy(PJ_OBJ_LIST *result);
/* ------------------------------------------------------------------------- */
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs);
+PJ PROJ_DLL *proj_crs_get_geodetic_crs(PJ_CONTEXT *ctx, const PJ *crs);
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs);
+PJ PROJ_DLL *proj_crs_get_horizontal_datum(PJ_CONTEXT *ctx, const PJ *crs);
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ_OBJ *crs, int index);
+PJ PROJ_DLL *proj_crs_get_sub_crs(PJ_CONTEXT *ctx, const PJ *crs, int index);
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_datum(PJ_CONTEXT *ctx, const PJ_OBJ *crs);
+PJ PROJ_DLL *proj_crs_get_datum(PJ_CONTEXT *ctx, const PJ *crs);
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ_OBJ *crs);
+PJ PROJ_DLL *proj_crs_get_coordinate_system(PJ_CONTEXT *ctx, const PJ *crs);
/** Type of coordinate system. */
typedef enum
@@ -842,14 +833,14 @@ typedef enum
PJ_CS_TYPE_TEMPORALMEASURE
} PJ_COORDINATE_SYSTEM_TYPE;
-PJ_COORDINATE_SYSTEM_TYPE PROJ_DLL proj_obj_cs_get_type(PJ_CONTEXT *ctx,
- const PJ_OBJ* cs);
+PJ_COORDINATE_SYSTEM_TYPE PROJ_DLL proj_cs_get_type(PJ_CONTEXT *ctx,
+ const PJ *cs);
-int PROJ_DLL proj_obj_cs_get_axis_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *cs);
+int PROJ_DLL proj_cs_get_axis_count(PJ_CONTEXT *ctx,
+ const PJ *cs);
-int PROJ_DLL proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx,
- const PJ_OBJ *cs, int index,
+int PROJ_DLL proj_cs_get_axis_info(PJ_CONTEXT *ctx,
+ const PJ *cs, int index,
const char **out_name,
const char **out_abbrev,
const char **out_direction,
@@ -858,46 +849,46 @@ int PROJ_DLL proj_obj_cs_get_axis_info(PJ_CONTEXT *ctx,
const char **out_unit_auth_name,
const char **out_unit_code);
-PJ_OBJ PROJ_DLL *proj_obj_get_ellipsoid(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj);
+PJ PROJ_DLL *proj_get_ellipsoid(PJ_CONTEXT *ctx,
+ const PJ *obj);
-int PROJ_DLL proj_obj_ellipsoid_get_parameters(PJ_CONTEXT *ctx,
- const PJ_OBJ *ellipsoid,
+int PROJ_DLL proj_ellipsoid_get_parameters(PJ_CONTEXT *ctx,
+ const PJ *ellipsoid,
double *out_semi_major_metre,
double *out_semi_minor_metre,
int *out_is_semi_minor_computed,
double *out_inv_flattening);
-PJ_OBJ PROJ_DLL *proj_obj_get_prime_meridian(PJ_CONTEXT *ctx,
- const PJ_OBJ *obj);
+PJ PROJ_DLL *proj_get_prime_meridian(PJ_CONTEXT *ctx,
+ const PJ *obj);
-int PROJ_DLL proj_obj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
- const PJ_OBJ *prime_meridian,
+int PROJ_DLL proj_prime_meridian_get_parameters(PJ_CONTEXT *ctx,
+ const PJ *prime_meridian,
double *out_longitude,
double *out_unit_conv_factor,
const char **out_unit_name);
-PJ_OBJ PROJ_DLL *proj_obj_crs_get_coordoperation(PJ_CONTEXT *ctx,
- const PJ_OBJ *crs);
+PJ PROJ_DLL *proj_crs_get_coordoperation(PJ_CONTEXT *ctx,
+ const PJ *crs);
int PROJ_DLL proj_coordoperation_get_method_info(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char **out_method_name,
const char **out_method_auth_name,
const char **out_method_code);
int PROJ_DLL proj_coordoperation_is_instanciable(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation);
+ const PJ *coordoperation);
int PROJ_DLL proj_coordoperation_get_param_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation);
+ const PJ *coordoperation);
int PROJ_DLL proj_coordoperation_get_param_index(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
const char *name);
int PROJ_DLL proj_coordoperation_get_param(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
int index,
const char **out_name,
const char **out_auth_name,
@@ -911,10 +902,10 @@ int PROJ_DLL proj_coordoperation_get_param(PJ_CONTEXT *ctx,
const char **out_unit_category);
int PROJ_DLL proj_coordoperation_get_grid_used_count(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation);
+ const PJ *coordoperation);
int PROJ_DLL proj_coordoperation_get_grid_used(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
int index,
const char **out_short_name,
const char **out_full_name,
@@ -925,10 +916,10 @@ int PROJ_DLL proj_coordoperation_get_grid_used(PJ_CONTEXT *ctx,
int *out_available);
double PROJ_DLL proj_coordoperation_get_accuracy(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj);
+ const PJ *obj);
int PROJ_DLL proj_coordoperation_get_towgs84_values(PJ_CONTEXT *ctx,
- const PJ_OBJ *coordoperation,
+ const PJ *coordoperation,
double *out_values,
int value_count,
int emit_error_if_incompatible);
diff --git a/src/proj_api.h b/src/proj_api.h
index a8a7f106..5c4d5e7a 100644
--- a/src/proj_api.h
+++ b/src/proj_api.h
@@ -82,7 +82,7 @@ extern "C" {
#define DEG_TO_RAD .017453292519943296
-#if defined(PROJECTS_H) || defined(PROJ_H)
+#if defined(PROJ_H)
#define PROJ_API_H_NOT_INVOKED_AS_PRIMARY_API
#endif
@@ -103,17 +103,10 @@ PROJ_DLL extern int pj_errno; /* global error return code */
/* These make the function declarations below conform with classic proj */
typedef PJ *projPJ; /* projPJ is a pointer to PJ */
typedef struct projCtx_t *projCtx; /* projCtx is a pointer to projCtx_t */
-#ifdef PROJ_H
# define projXY PJ_XY
# define projLP PJ_LP
# define projXYZ PJ_XYZ
# define projLPZ PJ_LPZ
-#else
-# define projXY XY
-# define projLP LP
-# define projXYZ XYZ
-# define projLPZ LPZ
-#endif
#else
/* i.e. proj_api invoked as primary API */
diff --git a/src/proj_experimental.h b/src/proj_experimental.h
index 292a3baf..27547d17 100644
--- a/src/proj_experimental.h
+++ b/src/proj_experimental.h
@@ -26,14 +26,15 @@
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
-#include "proj.h"
-
#ifndef PROJ_EXPERIMENTAL_H
#define PROJ_EXPERIMENTAL_H
+
#ifdef __cplusplus
extern "C" {
#endif
+#include "proj.h"
+
/**
* \file proj_experimental.h
*
@@ -89,7 +90,7 @@ typedef struct
PJ_UNIT_TYPE unit_type;
} PJ_AXIS_DESCRIPTION;
-PJ_OBJ PROJ_DLL *proj_obj_create_cs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_cs(PJ_CONTEXT *ctx,
PJ_COORDINATE_SYSTEM_TYPE type,
int axis_count,
const PJ_AXIS_DESCRIPTION* axis);
@@ -109,7 +110,7 @@ typedef enum
PJ_CART2D_WESTING_SOUTHING,
} PJ_CARTESIAN_CS_2D_TYPE;
-PJ_OBJ PROJ_DLL *proj_obj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_cartesian_2D_cs(PJ_CONTEXT *ctx,
PJ_CARTESIAN_CS_2D_TYPE type,
const char* unit_name,
double unit_conv_factor);
@@ -124,19 +125,19 @@ typedef enum
PJ_ELLPS2D_LATITUDE_LONGITUDE,
} PJ_ELLIPSOIDAL_CS_2D_TYPE;
-PJ_OBJ PROJ_DLL *proj_obj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_ellipsoidal_2D_cs(PJ_CONTEXT *ctx,
PJ_ELLIPSOIDAL_CS_2D_TYPE type,
const char* unit_name,
double unit_conv_factor);
-PJ_OBJ_LIST PROJ_DLL *proj_obj_query_geodetic_crs_from_datum(
+PJ_OBJ_LIST PROJ_DLL *proj_query_geodetic_crs_from_datum(
PJ_CONTEXT *ctx,
const char *crs_auth_name,
const char *datum_auth_name,
const char *datum_code,
const char *crs_type);
-PJ_OBJ PROJ_DLL *proj_obj_create_geographic_crs(
+PJ PROJ_DLL *proj_create_geographic_crs(
PJ_CONTEXT *ctx,
const char *crs_name,
const char *datum_name,
@@ -146,15 +147,15 @@ PJ_OBJ PROJ_DLL *proj_obj_create_geographic_crs(
double prime_meridian_offset,
const char *pm_angular_units,
double pm_units_conv,
- PJ_OBJ* ellipsoidal_cs);
+ PJ* ellipsoidal_cs);
-PJ_OBJ PROJ_DLL *proj_obj_create_geographic_crs_from_datum(
+PJ PROJ_DLL *proj_create_geographic_crs_from_datum(
PJ_CONTEXT *ctx,
const char *crs_name,
- PJ_OBJ* datum,
- PJ_OBJ* ellipsoidal_cs);
+ PJ* datum,
+ PJ* ellipsoidal_cs);
-PJ_OBJ PROJ_DLL *proj_obj_create_geocentric_crs(
+PJ PROJ_DLL *proj_create_geocentric_crs(
PJ_CONTEXT *ctx,
const char *crs_name,
const char *datum_name,
@@ -167,61 +168,61 @@ PJ_OBJ PROJ_DLL *proj_obj_create_geocentric_crs(
const char *linear_units,
double linear_units_conv);
-PJ_OBJ PROJ_DLL *proj_obj_create_geocentric_crs_from_datum(
+PJ PROJ_DLL *proj_create_geocentric_crs_from_datum(
PJ_CONTEXT *ctx,
const char *crs_name,
- const PJ_OBJ* datum,
+ const PJ* datum,
const char *linear_units,
double linear_units_conv);
-PJ_OBJ PROJ_DLL *proj_obj_alter_name(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj, const char* name);
+PJ PROJ_DLL *proj_alter_name(PJ_CONTEXT *ctx,
+ const PJ* obj, const char* name);
-PJ_OBJ PROJ_DLL *proj_obj_alter_id(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
+PJ PROJ_DLL *proj_alter_id(PJ_CONTEXT *ctx,
+ const PJ* obj,
const char* auth_name,
const char* code);
-PJ_OBJ PROJ_DLL *proj_obj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
- const PJ_OBJ* new_geod_crs);
+PJ PROJ_DLL *proj_crs_alter_geodetic_crs(PJ_CONTEXT *ctx,
+ const PJ* obj,
+ const PJ* new_geod_crs);
-PJ_OBJ PROJ_DLL *proj_obj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
+PJ PROJ_DLL *proj_crs_alter_cs_angular_unit(PJ_CONTEXT *ctx,
+ const PJ* obj,
const char *angular_units,
double angular_units_conv,
const char *unit_auth_name,
const char *unit_code);
-PJ_OBJ PROJ_DLL *proj_obj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
+PJ PROJ_DLL *proj_crs_alter_cs_linear_unit(PJ_CONTEXT *ctx,
+ const PJ* obj,
const char *linear_units,
double linear_units_conv,
const char *unit_auth_name,
const char *unit_code);
-PJ_OBJ PROJ_DLL *proj_obj_crs_alter_parameters_linear_unit(
+PJ PROJ_DLL *proj_crs_alter_parameters_linear_unit(
PJ_CONTEXT *ctx,
- const PJ_OBJ* obj,
+ const PJ* obj,
const char *linear_units,
double linear_units_conv,
const char *unit_auth_name,
const char *unit_code,
int convert_to_new_unit);
-PJ_OBJ PROJ_DLL *proj_obj_create_engineering_crs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_engineering_crs(PJ_CONTEXT *ctx,
const char *crsName);
-PJ_OBJ PROJ_DLL *proj_obj_create_vertical_crs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_vertical_crs(PJ_CONTEXT *ctx,
const char *crs_name,
const char *datum_name,
const char *linear_units,
double linear_units_conv);
-PJ_OBJ PROJ_DLL *proj_obj_create_compound_crs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_compound_crs(PJ_CONTEXT *ctx,
const char *crs_name,
- PJ_OBJ* horiz_crs,
- PJ_OBJ* vert_crs);
+ PJ* horiz_crs,
+ PJ* vert_crs);
/** Description of a parameter value for a Conversion. */
typedef struct
@@ -242,7 +243,7 @@ typedef struct
PJ_UNIT_TYPE unit_type;
} PJ_PARAM_DESCRIPTION;
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_conversion(PJ_CONTEXT *ctx,
const char* name,
const char* auth_name,
const char* code,
@@ -252,14 +253,14 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion(PJ_CONTEXT *ctx,
int param_count,
const PJ_PARAM_DESCRIPTION* params);
-PJ_OBJ PROJ_DLL *proj_obj_create_transformation(
+PJ PROJ_DLL *proj_create_transformation(
PJ_CONTEXT *ctx,
const char* name,
const char* auth_name,
const char* code,
- PJ_OBJ* source_crs,
- PJ_OBJ* target_crs,
- PJ_OBJ* interpolation_crs,
+ PJ* source_crs,
+ PJ* target_crs,
+ PJ* interpolation_crs,
const char* method_name,
const char* method_auth_name,
const char* method_code,
@@ -267,33 +268,33 @@ PJ_OBJ PROJ_DLL *proj_obj_create_transformation(
const PJ_PARAM_DESCRIPTION* params,
double accuracy);
-PJ_OBJ PROJ_DLL *proj_obj_convert_conversion_to_other_method(PJ_CONTEXT *ctx,
- const PJ_OBJ *conversion,
+PJ PROJ_DLL *proj_convert_conversion_to_other_method(PJ_CONTEXT *ctx,
+ const PJ *conversion,
int new_method_epsg_code,
const char *new_method_name);
-PJ_OBJ PROJ_DLL *proj_obj_create_projected_crs(PJ_CONTEXT *ctx,
+PJ PROJ_DLL *proj_create_projected_crs(PJ_CONTEXT *ctx,
const char* crs_name,
- const PJ_OBJ* geodetic_crs,
- const PJ_OBJ* conversion,
- const PJ_OBJ* coordinate_system);
+ const PJ* geodetic_crs,
+ const PJ* conversion,
+ const PJ* coordinate_system);
-PJ_OBJ PROJ_DLL *proj_obj_crs_create_bound_crs(PJ_CONTEXT *ctx,
- const PJ_OBJ *base_crs,
- const PJ_OBJ *hub_crs,
- const PJ_OBJ *transformation);
+PJ PROJ_DLL *proj_crs_create_bound_crs(PJ_CONTEXT *ctx,
+ const PJ *base_crs,
+ const PJ *hub_crs,
+ const PJ *transformation);
-PJ_OBJ PROJ_DLL *proj_obj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
- const PJ_OBJ *crs,
+PJ PROJ_DLL *proj_crs_create_bound_crs_to_WGS84(PJ_CONTEXT *ctx,
+ const PJ *crs,
const char *const *options);
/* BEGIN: Generated by scripts/create_c_api_projections.py*/
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_utm(
+PJ PROJ_DLL *proj_create_conversion_utm(
PJ_CONTEXT *ctx,
int zone,
int north);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_transverse_mercator(
+PJ PROJ_DLL *proj_create_conversion_transverse_mercator(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -303,7 +304,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_transverse_mercator(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
+PJ PROJ_DLL *proj_create_conversion_gauss_schreiber_transverse_mercator(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -313,7 +314,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gauss_schreiber_transverse_mercator(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_transverse_mercator_south_oriented(
+PJ PROJ_DLL *proj_create_conversion_transverse_mercator_south_oriented(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -323,7 +324,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_transverse_mercator_south_oriented(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_two_point_equidistant(
+PJ PROJ_DLL *proj_create_conversion_two_point_equidistant(
PJ_CONTEXT *ctx,
double latitude_first_point,
double longitude_first_point,
@@ -334,7 +335,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_two_point_equidistant(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_tunisia_mapping_grid(
+PJ PROJ_DLL *proj_create_conversion_tunisia_mapping_grid(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -343,7 +344,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_tunisia_mapping_grid(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_albers_equal_area(
+PJ PROJ_DLL *proj_create_conversion_albers_equal_area(
PJ_CONTEXT *ctx,
double latitude_false_origin,
double longitude_false_origin,
@@ -354,7 +355,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_albers_equal_area(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_1sp(
+PJ PROJ_DLL *proj_create_conversion_lambert_conic_conformal_1sp(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -364,7 +365,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_1sp(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp(
+PJ PROJ_DLL *proj_create_conversion_lambert_conic_conformal_2sp(
PJ_CONTEXT *ctx,
double latitude_false_origin,
double longitude_false_origin,
@@ -375,7 +376,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan(
+PJ PROJ_DLL *proj_create_conversion_lambert_conic_conformal_2sp_michigan(
PJ_CONTEXT *ctx,
double latitude_false_origin,
double longitude_false_origin,
@@ -387,7 +388,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp_michigan
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
+PJ PROJ_DLL *proj_create_conversion_lambert_conic_conformal_2sp_belgium(
PJ_CONTEXT *ctx,
double latitude_false_origin,
double longitude_false_origin,
@@ -398,7 +399,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_conic_conformal_2sp_belgium(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_azimuthal_equidistant(
+PJ PROJ_DLL *proj_create_conversion_azimuthal_equidistant(
PJ_CONTEXT *ctx,
double latitude_nat_origin,
double longitude_nat_origin,
@@ -407,7 +408,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_azimuthal_equidistant(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_guam_projection(
+PJ PROJ_DLL *proj_create_conversion_guam_projection(
PJ_CONTEXT *ctx,
double latitude_nat_origin,
double longitude_nat_origin,
@@ -416,7 +417,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_guam_projection(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_bonne(
+PJ PROJ_DLL *proj_create_conversion_bonne(
PJ_CONTEXT *ctx,
double latitude_nat_origin,
double longitude_nat_origin,
@@ -425,7 +426,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_bonne(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_cylindrical_equal_area_spherical(
+PJ PROJ_DLL *proj_create_conversion_lambert_cylindrical_equal_area_spherical(
PJ_CONTEXT *ctx,
double latitude_first_parallel,
double longitude_nat_origin,
@@ -434,7 +435,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_cylindrical_equal_area_spher
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_cylindrical_equal_area(
+PJ PROJ_DLL *proj_create_conversion_lambert_cylindrical_equal_area(
PJ_CONTEXT *ctx,
double latitude_first_parallel,
double longitude_nat_origin,
@@ -443,7 +444,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_cylindrical_equal_area(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_cassini_soldner(
+PJ PROJ_DLL *proj_create_conversion_cassini_soldner(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -452,7 +453,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_cassini_soldner(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_conic(
+PJ PROJ_DLL *proj_create_conversion_equidistant_conic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -463,7 +464,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_conic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_i(
+PJ PROJ_DLL *proj_create_conversion_eckert_i(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -471,7 +472,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_i(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_ii(
+PJ PROJ_DLL *proj_create_conversion_eckert_ii(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -479,7 +480,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_ii(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_iii(
+PJ PROJ_DLL *proj_create_conversion_eckert_iii(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -487,7 +488,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_iii(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_iv(
+PJ PROJ_DLL *proj_create_conversion_eckert_iv(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -495,7 +496,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_iv(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_v(
+PJ PROJ_DLL *proj_create_conversion_eckert_v(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -503,7 +504,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_v(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_vi(
+PJ PROJ_DLL *proj_create_conversion_eckert_vi(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -511,7 +512,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_eckert_vi(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_cylindrical(
+PJ PROJ_DLL *proj_create_conversion_equidistant_cylindrical(
PJ_CONTEXT *ctx,
double latitude_first_parallel,
double longitude_nat_origin,
@@ -520,7 +521,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_cylindrical(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_cylindrical_spherical(
+PJ PROJ_DLL *proj_create_conversion_equidistant_cylindrical_spherical(
PJ_CONTEXT *ctx,
double latitude_first_parallel,
double longitude_nat_origin,
@@ -529,7 +530,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equidistant_cylindrical_spherical(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gall(
+PJ PROJ_DLL *proj_create_conversion_gall(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -537,7 +538,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gall(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_goode_homolosine(
+PJ PROJ_DLL *proj_create_conversion_goode_homolosine(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -545,7 +546,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_goode_homolosine(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_interrupted_goode_homolosine(
+PJ PROJ_DLL *proj_create_conversion_interrupted_goode_homolosine(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -553,7 +554,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_interrupted_goode_homolosine(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_geostationary_satellite_sweep_x(
+PJ PROJ_DLL *proj_create_conversion_geostationary_satellite_sweep_x(
PJ_CONTEXT *ctx,
double center_long,
double height,
@@ -562,7 +563,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_geostationary_satellite_sweep_x(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_geostationary_satellite_sweep_y(
+PJ PROJ_DLL *proj_create_conversion_geostationary_satellite_sweep_y(
PJ_CONTEXT *ctx,
double center_long,
double height,
@@ -571,7 +572,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_geostationary_satellite_sweep_y(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gnomonic(
+PJ PROJ_DLL *proj_create_conversion_gnomonic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -580,7 +581,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_gnomonic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
+PJ PROJ_DLL *proj_create_conversion_hotine_oblique_mercator_variant_a(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double longitude_projection_centre,
@@ -592,7 +593,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_variant_a(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
+PJ PROJ_DLL *proj_create_conversion_hotine_oblique_mercator_variant_b(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double longitude_projection_centre,
@@ -604,7 +605,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_variant_b(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
+PJ PROJ_DLL *proj_create_conversion_hotine_oblique_mercator_two_point_natural_origin(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double latitude_point1,
@@ -617,7 +618,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_hotine_oblique_mercator_two_point_na
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_laborde_oblique_mercator(
+PJ PROJ_DLL *proj_create_conversion_laborde_oblique_mercator(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double longitude_projection_centre,
@@ -628,7 +629,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_laborde_oblique_mercator(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_international_map_world_polyconic(
+PJ PROJ_DLL *proj_create_conversion_international_map_world_polyconic(
PJ_CONTEXT *ctx,
double center_long,
double latitude_first_parallel,
@@ -638,7 +639,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_international_map_world_polyconic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_krovak_north_oriented(
+PJ PROJ_DLL *proj_create_conversion_krovak_north_oriented(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double longitude_of_origin,
@@ -650,7 +651,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_krovak_north_oriented(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_krovak(
+PJ PROJ_DLL *proj_create_conversion_krovak(
PJ_CONTEXT *ctx,
double latitude_projection_centre,
double longitude_of_origin,
@@ -662,7 +663,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_krovak(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_azimuthal_equal_area(
+PJ PROJ_DLL *proj_create_conversion_lambert_azimuthal_equal_area(
PJ_CONTEXT *ctx,
double latitude_nat_origin,
double longitude_nat_origin,
@@ -671,7 +672,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_lambert_azimuthal_equal_area(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_miller_cylindrical(
+PJ PROJ_DLL *proj_create_conversion_miller_cylindrical(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -679,7 +680,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_miller_cylindrical(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mercator_variant_a(
+PJ PROJ_DLL *proj_create_conversion_mercator_variant_a(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -689,7 +690,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mercator_variant_a(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mercator_variant_b(
+PJ PROJ_DLL *proj_create_conversion_mercator_variant_b(
PJ_CONTEXT *ctx,
double latitude_first_parallel,
double center_long,
@@ -698,7 +699,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mercator_variant_b(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_popular_visualisation_pseudo_mercator(
+PJ PROJ_DLL *proj_create_conversion_popular_visualisation_pseudo_mercator(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -707,7 +708,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_popular_visualisation_pseudo_mercato
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mollweide(
+PJ PROJ_DLL *proj_create_conversion_mollweide(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -715,7 +716,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_mollweide(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_new_zealand_mapping_grid(
+PJ PROJ_DLL *proj_create_conversion_new_zealand_mapping_grid(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -724,7 +725,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_new_zealand_mapping_grid(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_oblique_stereographic(
+PJ PROJ_DLL *proj_create_conversion_oblique_stereographic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -734,7 +735,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_oblique_stereographic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_orthographic(
+PJ PROJ_DLL *proj_create_conversion_orthographic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -743,7 +744,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_orthographic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_american_polyconic(
+PJ PROJ_DLL *proj_create_conversion_american_polyconic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -752,7 +753,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_american_polyconic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_polar_stereographic_variant_a(
+PJ PROJ_DLL *proj_create_conversion_polar_stereographic_variant_a(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -762,7 +763,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_polar_stereographic_variant_a(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_polar_stereographic_variant_b(
+PJ PROJ_DLL *proj_create_conversion_polar_stereographic_variant_b(
PJ_CONTEXT *ctx,
double latitude_standard_parallel,
double longitude_of_origin,
@@ -771,7 +772,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_polar_stereographic_variant_b(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_robinson(
+PJ PROJ_DLL *proj_create_conversion_robinson(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -779,7 +780,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_robinson(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_sinusoidal(
+PJ PROJ_DLL *proj_create_conversion_sinusoidal(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -787,7 +788,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_sinusoidal(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_stereographic(
+PJ PROJ_DLL *proj_create_conversion_stereographic(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -797,7 +798,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_stereographic(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_van_der_grinten(
+PJ PROJ_DLL *proj_create_conversion_van_der_grinten(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -805,7 +806,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_van_der_grinten(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_i(
+PJ PROJ_DLL *proj_create_conversion_wagner_i(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -813,7 +814,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_i(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_ii(
+PJ PROJ_DLL *proj_create_conversion_wagner_ii(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -821,7 +822,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_ii(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_iii(
+PJ PROJ_DLL *proj_create_conversion_wagner_iii(
PJ_CONTEXT *ctx,
double latitude_true_scale,
double center_long,
@@ -830,7 +831,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_iii(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_iv(
+PJ PROJ_DLL *proj_create_conversion_wagner_iv(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -838,7 +839,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_iv(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_v(
+PJ PROJ_DLL *proj_create_conversion_wagner_v(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -846,7 +847,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_v(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_vi(
+PJ PROJ_DLL *proj_create_conversion_wagner_vi(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -854,7 +855,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_vi(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_vii(
+PJ PROJ_DLL *proj_create_conversion_wagner_vii(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
@@ -862,7 +863,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_wagner_vii(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_quadrilateralized_spherical_cube(
+PJ PROJ_DLL *proj_create_conversion_quadrilateralized_spherical_cube(
PJ_CONTEXT *ctx,
double center_lat,
double center_long,
@@ -871,7 +872,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_quadrilateralized_spherical_cube(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_spherical_cross_track_height(
+PJ PROJ_DLL *proj_create_conversion_spherical_cross_track_height(
PJ_CONTEXT *ctx,
double peg_point_lat,
double peg_point_long,
@@ -880,7 +881,7 @@ PJ_OBJ PROJ_DLL *proj_obj_create_conversion_spherical_cross_track_height(
const char* ang_unit_name, double ang_unit_conv_factor,
const char* linear_unit_name, double linear_unit_conv_factor);
-PJ_OBJ PROJ_DLL *proj_obj_create_conversion_equal_earth(
+PJ PROJ_DLL *proj_create_conversion_equal_earth(
PJ_CONTEXT *ctx,
double center_long,
double false_easting,
diff --git a/src/proj_internal.h b/src/proj_internal.h
index e0999d88..7573e1bf 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -26,20 +26,45 @@
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
-#ifdef _MSC_VER
-#ifndef _USE_MATH_DEFINES
-#define _USE_MATH_DEFINES
+#ifndef PROJ_INTERNAL_H
+#define PROJ_INTERNAL_H
+
+#ifndef __cplusplus
+#error "proj_internal.h can only be included from a C++ file"
#endif
+
+#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
+#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
+#endif
+
+#ifdef _MSC_VER
+# ifndef _CRT_SECURE_NO_DEPRECATE
+# define _CRT_SECURE_NO_DEPRECATE
+# endif
+# ifndef _CRT_NONSTDC_NO_DEPRECATE
+# define _CRT_NONSTDC_NO_DEPRECATE
+# endif
+/* enable predefined math constants M_* for MS Visual Studio workaround */
+# ifndef _USE_MATH_DEFINES
+# define _USE_MATH_DEFINES
+# endif
#endif
-#include <math.h> /* For M_PI */
+/* standard inclusions */
+#include <limits.h>
+#include <math.h>
#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "proj/common.hpp"
+#include "proj/coordinateoperation.hpp"
+#include <string>
+#include <vector>
#include "proj.h"
-#ifdef PROJECTS_H
-#error proj_internal.h must be included before projects.h
-#endif
#ifdef PROJ_API_H
#error proj_internal.h must be included before proj_api.h
#endif
@@ -48,12 +73,6 @@
#include "proj_symbol_rename.h"
#endif
-#ifndef PROJ_INTERNAL_H
-#define PROJ_INTERNAL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define STATIC_ASSERT(COND) ((void)sizeof(char[(COND) ? 1 : -1]))
#if !defined(HAVE_C99_MATH)
@@ -70,6 +89,89 @@ extern "C" {
/* Maximum latitudinal overshoot accepted */
#define PJ_EPS_LAT 1e-12
+#define C_NAMESPACE extern "C"
+#define C_NAMESPACE_VAR extern "C"
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#ifndef MAX
+# define MIN(a,b) ((a<b) ? a : b)
+# define MAX(a,b) ((a>b) ? a : b)
+#endif
+
+#ifndef ABS
+# define ABS(x) ((x<0) ? (-1*(x)) : x)
+#endif
+
+#if INT_MAX == 2147483647
+typedef int pj_int32;
+#elif LONG_MAX == 2147483647
+typedef long pj_int32;
+#else
+#warning It seems no 32-bit integer type is available
+#endif
+
+/* maximum path/filename */
+#ifndef MAX_PATH_FILENAME
+#define MAX_PATH_FILENAME 1024
+#endif
+
+/* If we still haven't got M_PI*, we rely on our own defines.
+ * For example, this is necessary when compiling with gcc and
+ * the -ansi flag.
+ */
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
+#define M_PI_4 0.78539816339744830962
+#define M_2_PI 0.63661977236758134308
+#endif
+
+/* M_SQRT2 might be missing */
+#ifndef M_SQRT2
+#define M_SQRT2 1.41421356237309504880
+#endif
+
+/* some more useful math constants and aliases */
+#define M_FORTPI M_PI_4 /* pi/4 */
+#define M_HALFPI M_PI_2 /* pi/2 */
+#define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */
+#define M_TWOPI 6.28318530717958647693 /* 2*pi */
+#define M_TWO_D_PI M_2_PI /* 2/pi */
+#define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */
+
+
+/* maximum tag id length for +init and default files */
+#ifndef ID_TAG_MAX
+#define ID_TAG_MAX 50
+#endif
+
+/* Use WIN32 as a standard windows 32 bit declaration */
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32
+#endif
+
+#if defined(_WINDOWS) && !defined(WIN32)
+# define WIN32
+#endif
+
+/* directory delimiter for DOS support */
+#ifdef WIN32
+#define DIR_CHAR '\\'
+#else
+#define DIR_CHAR '/'
+#endif
+
/* This enum is also conditionally defined in projects.h - but enums cannot */
/* be forward declared and we need it here for the pj_left/right prototypes */
@@ -115,7 +217,6 @@ void proj_context_log_debug (PJ_CONTEXT *ctx, const char *fmt, ...);
int pj_ellipsoid (PJ *);
void pj_inherit_ellipsoid_def (const PJ *src, PJ *dst);
-void pj_erase_ellipsoid_def (PJ *P);
int pj_calc_ellipsoid_params (PJ *P, double a, double es);
/* Geographical to geocentric latitude - another of the "simple, but useful" */
@@ -133,8 +234,667 @@ void proj_fileapi_set (PJ *P, void *fileapi);
const char * const *proj_get_searchpath(void);
int proj_get_path_count(void);
-#ifdef __cplusplus
-}
+typedef struct { double r, i; } COMPLEX;
+
+/* Forward declarations and typedefs for stuff needed inside the PJ object */
+struct PJconsts;
+
+union PJ_COORD;
+struct geod_geodesic;
+struct ARG_list;
+struct PJ_REGION_S;
+typedef struct PJ_REGION_S PJ_Region;
+typedef struct ARG_list paralist; /* parameter list */
+#ifndef PROJ_INTERNAL_H
+enum pj_io_units {
+ PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */
+ PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */
+ PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */
+ PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */
+ PJ_IO_UNITS_ANGULAR = 4 /* Radians */
+};
+#endif
+#ifndef PROJ_H
+typedef struct PJconsts PJ; /* the PJ object herself */
+typedef union PJ_COORD PJ_COORD;
+#endif
+
+struct PJ_REGION_S {
+ double ll_long; /* lower left corner coordinates (radians) */
+ double ll_lat;
+ double ur_long; /* upper right corner coordinates (radians) */
+ double ur_lat;
+};
+
+struct PJ_AREA {
+ int bbox_set;
+ double west_lon_degree;
+ double south_lat_degree;
+ double east_lon_degree;
+ double north_lat_degree;
+};
+
+struct projCtx_t;
+typedef struct projCtx_t projCtx_t;
+
+/*****************************************************************************
+
+ Some function types that are especially useful when working with PJs
+
+******************************************************************************
+
+PJ_CONSTRUCTOR:
+
+ A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ.
+ Historically called twice: First with a 0 argument, to allocate memory,
+ second with the first return value as argument, for actual setup.
+
+PJ_DESTRUCTOR:
+
+ A function taking a pointer-to-PJ and an integer as args, then first
+ handling the deallocation of the PJ, afterwards handing the integer over
+ to the error reporting subsystem, and finally returning a null pointer in
+ support of the "return free (P)" (aka "get the hell out of here") idiom.
+
+PJ_OPERATOR:
+
+ A function taking a PJ_COORD and a pointer-to-PJ as args, applying the
+ PJ to the PJ_COORD, and returning the resulting PJ_COORD.
+
+*****************************************************************************/
+typedef PJ *(* PJ_CONSTRUCTOR) (PJ *);
+typedef PJ *(* PJ_DESTRUCTOR) (PJ *, int);
+typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *);
+/****************************************************************************/
+
+
+/* datum_type values */
+#define PJD_UNKNOWN 0
+#define PJD_3PARAM 1
+#define PJD_7PARAM 2
+#define PJD_GRIDSHIFT 3
+#define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */
+
+
+/* base projection data structure */
+struct PJconsts {
+
+ /*************************************************************************************
+
+ G E N E R A L P A R A M E T E R S T R U C T
+
+ **************************************************************************************
+
+ TODO: Need some description here - especially about the thread context...
+ This is the struct behind the PJ typedef
+
+ **************************************************************************************/
+
+ projCtx_t *ctx = nullptr;
+ const char *descr = nullptr; /* From pj_list.h or individual PJ_*.c file */
+ paralist *params = nullptr; /* Parameter list */
+ char *def_full = nullptr; /* Full textual definition (usually 0 - set by proj_pj_info) */
+ char *def_size = nullptr; /* Shape and size parameters extracted from params */
+ char *def_shape = nullptr;
+ char *def_spherification = nullptr;
+ char *def_ellps = nullptr;
+
+ struct geod_geodesic *geod = nullptr; /* For geodesic computations */
+ void *opaque = nullptr; /* Projection specific parameters, Defined in PJ_*.c */
+ int inverted = 0; /* Tell high level API functions to swap inv/fwd */
+
+
+ /*************************************************************************************
+
+ F U N C T I O N P O I N T E R S
+
+ **************************************************************************************
+
+ For projection xxx, these are pointers to functions in the corresponding
+ PJ_xxx.c file.
+
+ pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(),
+ a name which is currently hidden behind the magic curtain of the PROJECTION
+ macro.
+
+ **************************************************************************************/
+
+
+ PJ_XY (*fwd)(PJ_LP, PJ *) = nullptr;
+ PJ_LP (*inv)(PJ_XY, PJ *) = nullptr;
+ PJ_XYZ (*fwd3d)(PJ_LPZ, PJ *) = nullptr;
+ PJ_LPZ (*inv3d)(PJ_XYZ, PJ *) = nullptr;
+ PJ_OPERATOR fwd4d = nullptr;
+ PJ_OPERATOR inv4d = nullptr;
+
+ PJ_DESTRUCTOR destructor = nullptr;
+
+
+ /*************************************************************************************
+
+ E L L I P S O I D P A R A M E T E R S
+
+ **************************************************************************************
+
+ Despite YAGNI, we add a large number of ellipsoidal shape parameters, which
+ are not yet set up in pj_init. They are, however, inexpensive to compute,
+ compared to the overall time taken for setting up the complex PJ object
+ (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity).
+
+ But during single point projections it will often be a useful thing to have
+ these readily available without having to recompute at every pj_fwd / pj_inv
+ call.
+
+ With this wide selection, we should be ready for quite a number of geodetic
+ algorithms, without having to incur further ABI breakage.
+
+ **************************************************************************************/
+
+ /* The linear parameters */
+
+ double a = 0.0; /* semimajor axis (radius if eccentricity==0) */
+ double b = 0.0; /* semiminor axis */
+ double ra = 0.0; /* 1/a */
+ double rb = 0.0; /* 1/b */
+
+ /* The eccentricities */
+
+ double alpha = 0.0; /* angular eccentricity */
+ double e = 0.0; /* first eccentricity */
+ double es = 0.0; /* first eccentricity squared */
+ double e2 = 0.0; /* second eccentricity */
+ double e2s = 0.0; /* second eccentricity squared */
+ double e3 = 0.0; /* third eccentricity */
+ double e3s = 0.0; /* third eccentricity squared */
+ double one_es = 0.0; /* 1 - e^2 */
+ double rone_es = 0.0; /* 1/one_es */
+
+
+ /* The flattenings */
+ double f = 0.0; /* first flattening */
+ double f2 = 0.0; /* second flattening */
+ double n = 0.0; /* third flattening */
+ double rf = 0.0; /* 1/f */
+ double rf2 = 0.0; /* 1/f2 */
+ double rn = 0.0; /* 1/n */
+
+ /* This one's for GRS80 */
+ double J = 0.0; /* "Dynamic form factor" */
+
+ double es_orig = 0.0; /* es and a before any +proj related adjustment */
+ double a_orig = 0.0;
+
+
+ /*************************************************************************************
+
+ C O O R D I N A T E H A N D L I N G
+
+ **************************************************************************************/
+
+ int over = 0; /* Over-range flag */
+ int geoc = 0; /* Geocentric latitude flag */
+ int is_latlong = 0; /* proj=latlong ... not really a projection at all */
+ int is_geocent = 0; /* proj=geocent ... not really a projection at all */
+ int is_pipeline = 0; /* 1 if PJ represents a pipeline */
+ int need_ellps = 0; /* 0 for operations that are purely cartesian */
+ int skip_fwd_prepare = 0;
+ int skip_fwd_finalize = 0;
+ int skip_inv_prepare = 0;
+ int skip_inv_finalize = 0;
+
+ enum pj_io_units left = PJ_IO_UNITS_WHATEVER; /* Flags for input/output coordinate types */
+ enum pj_io_units right = PJ_IO_UNITS_WHATEVER;
+
+ /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */
+ PJ *axisswap = nullptr;
+ PJ *cart = nullptr;
+ PJ *cart_wgs84 = nullptr;
+ PJ *helmert = nullptr;
+ PJ *hgridshift = nullptr;
+ PJ *vgridshift = nullptr;
+
+
+ /*************************************************************************************
+
+ C A R T O G R A P H I C O F F S E T S
+
+ **************************************************************************************/
+
+ double lam0 = 0.0; /* central meridian */
+ double phi0 = 0.0; /* central parallel */
+ double x0 = 0.0; /* false easting */
+ double y0 = 0.0; /* false northing */
+ double z0 = 0.0; /* height origin */
+ double t0 = 0.0; /* time origin */
+
+
+ /*************************************************************************************
+
+ S C A L I N G
+
+ **************************************************************************************/
+
+ double k0 = 0.0; /* General scaling factor - e.g. the 0.9996 of UTM */
+ double to_meter = 0.0, fr_meter = 0.0; /* Plane coordinate scaling. Internal unit [m] */
+ double vto_meter = 0.0, vfr_meter = 0.0; /* Vertical scaling. Internal unit [m] */
+
+
+ /*************************************************************************************
+
+ D A T U M S A N D H E I G H T S Y S T E M S
+
+ **************************************************************************************
+
+ It may be possible, and meaningful, to move the list parts of this up to the
+ PJ_CONTEXT level.
+
+ **************************************************************************************/
+
+ int datum_type = PJD_UNKNOWN; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */
+ double datum_params[7] = {0,0,0,0,0,0,0}; /* Parameters for 3PARAM and 7PARAM */
+ struct _pj_gi **gridlist = nullptr; /* TODO: Description needed */
+ int gridlist_count = 0;
+
+ int has_geoid_vgrids = 0; /* TODO: Description needed */
+ struct _pj_gi **vgridlist_geoid = nullptr; /* TODO: Description needed */
+ int vgridlist_geoid_count = 0;
+
+ double from_greenwich = 0.0; /* prime meridian offset (in radians) */
+ double long_wrap_center = 0.0; /* 0.0 for -180 to 180, actually in radians*/
+ int is_long_wrap_set = 0;
+ char axis[4] = {0,0,0,0}; /* Axis order, pj_transform/pj_adjust_axis */
+
+ /* New Datum Shift Grid Catalogs */
+ char *catalog_name = nullptr;
+ struct _PJ_GridCatalog *catalog = nullptr;
+
+ double datum_date = 0.0; /* TODO: Description needed */
+
+ struct _pj_gi *last_before_grid = nullptr; /* TODO: Description needed */
+ PJ_Region last_before_region = {0,0,0,0}; /* TODO: Description needed */
+ double last_before_date = 0.0; /* TODO: Description needed */
+
+ struct _pj_gi *last_after_grid = nullptr; /* TODO: Description needed */
+ PJ_Region last_after_region = {0,0,0,0}; /* TODO: Description needed */
+ double last_after_date = 0.0; /* TODO: Description needed */
+
+ /*************************************************************************************
+ ISO-19111 interface
+ **************************************************************************************/
+
+ NS_PROJ::common::IdentifiedObjectPtr iso_obj{};
+
+ // cached results
+ mutable std::string lastWKT{};
+ mutable std::string lastPROJString{};
+ mutable bool gridsNeededAsked = false;
+ mutable std::vector<NS_PROJ::operation::GridDescription> gridsNeeded{};
+
+ /*************************************************************************************
+
+ E N D O F G E N E R A L P A R A M E T E R S T R U C T
+
+ **************************************************************************************/
+
+ PJconsts();
+ PJconsts(const PJconsts &) = delete;
+ PJconsts &operator=(const PJconsts &) = delete;
+};
+
+
+
+
+/* Parameter list (a copy of the +proj=... etc. parameters) */
+struct ARG_list {
+ paralist *next;
+ char used;
+#if defined(__GNUC__) && __GNUC__ >= 8
+ char param[]; /* variable-length member */
+ /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */
+ /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */
+#else
+ char param[1]; /* variable-length member */
+#endif
+};
+
+
+typedef union { double f; int i; char *s; } PROJVALUE;
+
+
+struct PJ_DATUMS {
+ const char *id; /* datum keyword */
+ const char *defn; /* ie. "to_wgs84=..." */
+ const char *ellipse_id; /* ie from ellipse table */
+ const char *comments; /* EPSG code, etc */
+};
+
+
+struct DERIVS {
+ double x_l, x_p; /* derivatives of x for lambda-phi */
+ double y_l, y_p; /* derivatives of y for lambda-phi */
+};
+
+struct FACTORS {
+ struct 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; /* always 0 */
+};
+
+/* library errors */
+#define PJD_ERR_NO_ARGS -1
+#define PJD_ERR_NO_OPTION_IN_INIT_FILE -2
+#define PJD_ERR_NO_COLON_IN_INIT_STRING -3
+#define PJD_ERR_PROJ_NOT_NAMED -4
+#define PJD_ERR_UNKNOWN_PROJECTION_ID -5
+#define PJD_ERR_ECCENTRICITY_IS_ONE -6
+#define PJD_ERR_UNKNOWN_UNIT_ID -7
+#define PJD_ERR_INVALID_BOOLEAN_PARAM -8
+#define PJD_ERR_UNKNOWN_ELLP_PARAM -9
+#define PJD_ERR_REV_FLATTENING_IS_ZERO -10
+#define PJD_ERR_REF_RAD_LARGER_THAN_90 -11
+#define PJD_ERR_ES_LESS_THAN_ZERO -12
+#define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13
+#define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14
+#define PJD_ERR_INVALID_X_OR_Y -15
+#define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16
+#define PJD_ERR_NON_CONV_INV_MERI_DIST -17
+#define PJD_ERR_NON_CON_INV_PHI2 -18
+#define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19
+#define PJD_ERR_TOLERANCE_CONDITION -20
+#define PJD_ERR_CONIC_LAT_EQUAL -21
+#define PJD_ERR_LAT_LARGER_THAN_90 -22
+#define PJD_ERR_LAT1_IS_ZERO -23
+#define PJD_ERR_LAT_TS_LARGER_THAN_90 -24
+#define PJD_ERR_CONTROL_POINT_NO_DIST -25
+#define PJD_ERR_NO_ROTATION_PROJ -26
+#define PJD_ERR_W_OR_M_ZERO_OR_LESS -27
+#define PJD_ERR_LSAT_NOT_IN_RANGE -28
+#define PJD_ERR_PATH_NOT_IN_RANGE -29
+#define PJD_ERR_H_LESS_THAN_ZERO -30
+#define PJD_ERR_K_LESS_THAN_ZERO -31
+#define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32
+#define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33
+#define PJD_ERR_ELLIPSOID_USE_REQUIRED -34
+#define PJD_ERR_INVALID_UTM_ZONE -35
+#define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36
+#define PJD_ERR_FAILED_TO_FIND_PROJ -37
+#define PJD_ERR_FAILED_TO_LOAD_GRID -38
+#define PJD_ERR_INVALID_M_OR_N -39
+#define PJD_ERR_N_OUT_OF_RANGE -40
+#define PJD_ERR_LAT_1_2_UNSPECIFIED -41
+#define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42
+#define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43
+#define PJD_ERR_UNPARSEABLE_CS_DEF -44
+#define PJD_ERR_GEOCENTRIC -45
+#define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46
+#define PJD_ERR_AXIS -47
+#define PJD_ERR_GRID_AREA -48
+#define PJD_ERR_INVALID_SWEEP_AXIS -49
+#define PJD_ERR_MALFORMED_PIPELINE -50
+#define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51
+#define PJD_ERR_INVALID_SCALE -52
+#define PJD_ERR_NON_CONVERGENT -53
+#define PJD_ERR_MISSING_ARGS -54
+#define PJD_ERR_LAT_0_IS_ZERO -55
+#define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56
+#define PJD_ERR_TOO_MANY_INITS -57
+#define PJD_ERR_INVALID_ARG -58
+#define PJD_ERR_INCONSISTENT_UNIT -59
+/* NOTE: Remember to update pj_strerrno.c and transient_error in */
+/* pj_transform.c when adding new value */
+
+struct projFileAPI_t;
+
+struct projCppContext;
+
+/* proj thread context */
+struct projCtx_t {
+ int last_errno;
+ int debug_level;
+ void (*logger)(void *, int, const char *);
+ void *app_data;
+ struct projFileAPI_t *fileapi;
+ struct projCppContext* cpp_context; /* internal context for C++ code */
+ int use_proj4_init_rules; /* -1 = unknown, 0 = no, 1 = yes */
+ int epsg_file_exists; /* -1 = unknown, 0 = no, 1 = yes */
+};
+
+/* Generate pj_list external or make list from include file */
+#ifndef PJ_DATUMS__
+C_NAMESPACE_VAR struct PJ_DATUMS pj_datums[];
#endif
+
+
+
+
+#ifdef PJ_LIB__
+#define PROJ_HEAD(name, desc) static const char des_##name [] = desc
+
+#define OPERATION(name, NEED_ELPJ_LPS) \
+ \
+pj_projection_specific_setup_##name (PJ *P); \
+C_NAMESPACE PJ *pj_##name (PJ *P); \
+ \
+C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \
+ \
+C_NAMESPACE PJ *pj_##name (PJ *P) { \
+ if (P) \
+ return pj_projection_specific_setup_##name (P); \
+ P = pj_new(); \
+ if (nullptr==P) \
+ return nullptr; \
+ P->descr = des_##name; \
+ P->need_ellps = NEED_ELPJ_LPS; \
+ P->left = PJ_IO_UNITS_ANGULAR; \
+ P->right = PJ_IO_UNITS_CLASSIC; \
+ return P; \
+} \
+ \
+PJ *pj_projection_specific_setup_##name (PJ *P)
+
+/* In ISO19000 lingo, an operation is either a conversion or a transformation */
+#define CONVERSION(name, need_ellps) OPERATION (name, need_ellps)
+#define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps)
+
+/* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */
+#define PROJECTION(name) CONVERSION (name, 1)
+
+#endif /* def PJ_LIB__ */
+
+
+#define MAX_TAB_ID 80
+typedef struct { float lam, phi; } FLP;
+typedef struct { pj_int32 lam, phi; } ILP;
+
+struct CTABLE {
+ char id[MAX_TAB_ID]; /* ascii info */
+ PJ_LP ll; /* lower left corner coordinates */
+ PJ_LP del; /* size of cells */
+ ILP lim; /* limits of conversion matrix */
+ FLP *cvs; /* conversion matrix */
+};
+
+typedef struct _pj_gi {
+ char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */
+ char *filename; /* full path to filename */
+
+ const char *format; /* format of this grid, ie "ctable", "ntv1",
+ "ntv2" or "missing". */
+
+ long grid_offset; /* offset in file, for delayed loading */
+ int must_swap; /* only for NTv2 */
+
+ struct CTABLE *ct;
+
+ struct _pj_gi *next;
+ struct _pj_gi *child;
+} PJ_GRIDINFO;
+
+typedef struct {
+ PJ_Region region;
+ int priority; /* higher used before lower */
+ double date; /* year.fraction */
+ char *definition; /* usually the gridname */
+
+ PJ_GRIDINFO *gridinfo;
+ int available; /* 0=unknown, 1=true, -1=false */
+} PJ_GridCatalogEntry;
+
+typedef struct _PJ_GridCatalog {
+ char *catalog_name;
+
+ PJ_Region region; /* maximum extent of catalog data */
+
+ int entry_count;
+ PJ_GridCatalogEntry *entries;
+
+ struct _PJ_GridCatalog *next;
+} PJ_GridCatalog;
+
+/* procedure prototypes */
+double PROJ_DLL dmstor(const char *, char **);
+double dmstor_ctx(projCtx_t *ctx, const char *, char **);
+void PROJ_DLL set_rtodms(int, int);
+char PROJ_DLL *rtodms(char *, double, int, int);
+double PROJ_DLL adjlon(double);
+double aacos(projCtx_t *,double);
+double aasin(projCtx_t *,double);
+double asqrt(double);
+double aatan2(double, double);
+
+PROJVALUE PROJ_DLL pj_param(projCtx_t *ctx, paralist *, const char *);
+paralist PROJ_DLL *pj_param_exists (paralist *list, const char *parameter);
+paralist PROJ_DLL *pj_mkparam(const char *);
+paralist *pj_mkparam_ws (const char *str);
+
+
+int PROJ_DLL pj_ell_set(projCtx_t *ctx, paralist *, double *, double *);
+int pj_datum_set(projCtx_t *,paralist *, PJ *);
+int pj_angular_units_set(paralist *, PJ *);
+
+paralist *pj_clone_paralist( const paralist* );
+paralist *pj_search_initcache( const char *filekey );
+void pj_insert_initcache( const char *filekey, const paralist *list);
+paralist *pj_expand_init(projCtx_t *ctx, paralist *init);
+
+void *pj_dealloc_params (projCtx_t *ctx, paralist *start, int errlev);
+
+
+double *pj_enfn(double);
+double pj_mlfn(double, double, double, double *);
+double pj_inv_mlfn(projCtx_t *, double, double, double *);
+double pj_qsfn(double, double, double);
+double pj_tsfn(double, double, double);
+double pj_msfn(double, double, double);
+double PROJ_DLL pj_phi2(projCtx_t *, double, double);
+double pj_qsfn_(double, PJ *);
+double *pj_authset(double);
+double pj_authlat(double, double *);
+
+COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int);
+COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *);
+
+int pj_deriv(PJ_LP, double, const PJ *, struct DERIVS *);
+int pj_factors(PJ_LP, const PJ *, double, struct FACTORS *);
+
+struct PW_COEF { /* row coefficient structure */
+ int m; /* number of c coefficients (=0 for none) */
+ double *c; /* power coefficients */
+};
+
+/* Approximation structures and procedures */
+typedef struct { /* Chebyshev or Power series structure */
+ PJ_UV a, b; /* power series range for evaluation */
+ /* or Chebyshev argument shift/scaling */
+ struct PW_COEF *cu, *cv;
+ int mu, mv; /* maximum cu and cv index (+1 for count) */
+ int power; /* != 0 if power series, else Chebyshev */
+} Tseries;
+
+Tseries PROJ_DLL *mk_cheby(PJ_UV, PJ_UV, double, PJ_UV *, PJ_UV (*)(PJ_UV), int, int, int);
+PJ_UV bpseval(PJ_UV, Tseries *);
+PJ_UV bcheval(PJ_UV, Tseries *);
+PJ_UV biveval(PJ_UV, Tseries *);
+void *vector1(int, int);
+void **vector2(int, int, int);
+void freev2(void **v, int nrows);
+int bchgen(PJ_UV, PJ_UV, int, int, PJ_UV **, PJ_UV(*)(PJ_UV));
+int bch2bps(PJ_UV, PJ_UV, PJ_UV **, int, int);
+
+/* nadcon related protos */
+PJ_LP nad_intr(PJ_LP, struct CTABLE *);
+PJ_LP nad_cvt(PJ_LP, int, struct CTABLE *);
+struct CTABLE *nad_init(projCtx_t *ctx, char *);
+struct CTABLE *nad_ctable_init( projCtx_t *ctx, struct projFileAPI_t* fid );
+int nad_ctable_load( projCtx_t *ctx, struct CTABLE *, struct projFileAPI_t* fid );
+struct CTABLE *nad_ctable2_init( projCtx_t *ctx, struct projFileAPI_t* fid );
+int nad_ctable2_load( projCtx_t *ctx, struct CTABLE *, struct projFileAPI_t* fid );
+void nad_free(struct CTABLE *);
+
+/* higher level handling of datum grid shift files */
+
+int pj_apply_vgridshift( PJ *defn, const char *listname,
+ PJ_GRIDINFO ***gridlist_p,
+ int *gridlist_count_p,
+ int inverse,
+ long point_count, int point_offset,
+ double *x, double *y, double *z );
+int pj_apply_gridshift_2( PJ *defn, int inverse,
+ long point_count, int point_offset,
+ double *x, double *y, double *z );
+int pj_apply_gridshift_3( projCtx_t *ctx,
+ PJ_GRIDINFO **gridlist, int gridlist_count,
+ int inverse, long point_count, int point_offset,
+ double *x, double *y, double *z );
+
+PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx_t *, const char *, int * );
+
+PJ_GRIDINFO *pj_gridinfo_init( projCtx_t *, const char * );
+int pj_gridinfo_load( projCtx_t *, PJ_GRIDINFO * );
+void pj_gridinfo_free( projCtx_t *, PJ_GRIDINFO * );
+
+PJ_GridCatalog *pj_gc_findcatalog( projCtx_t *, const char * );
+PJ_GridCatalog *pj_gc_readcatalog( projCtx_t *, const char * );
+void pj_gc_unloadall( projCtx_t *);
+int pj_gc_apply_gridshift( PJ *defn, int inverse,
+ long point_count, int point_offset,
+ double *x, double *y, double *z );
+int pj_gc_apply_gridshift( PJ *defn, int inverse,
+ long point_count, int point_offset,
+ double *x, double *y, double *z );
+
+PJ_GRIDINFO *pj_gc_findgrid( projCtx_t *ctx,
+ PJ_GridCatalog *catalog, int after,
+ PJ_LP location, double date,
+ PJ_Region *optional_region,
+ double *grid_date );
+
+double pj_gc_parsedate( projCtx_t *, const char * );
+
+void *proj_mdist_ini(double);
+double proj_mdist(double, double, double, const void *);
+double proj_inv_mdist(projCtx_t *ctx, double, const void *);
+void *pj_gauss_ini(double, double, double *,double *);
+PJ_LP pj_gauss(projCtx_t *, PJ_LP, const void *);
+PJ_LP pj_inv_gauss(projCtx_t *, PJ_LP, const void *);
+
+struct PJ_DATUMS PROJ_DLL *pj_get_datums_ref( void );
+
+PJ *pj_new(void);
+PJ *pj_default_destructor (PJ *P, int errlev);
+
+double PROJ_DLL pj_atof( const char* nptr );
+double pj_strtod( const char *nptr, char **endptr );
+void pj_freeup_plain (PJ *P);
+
+PJ* pj_init_ctx_with_allow_init_epsg( projCtx_t *ctx, int argc, char **argv, int allow_init_epsg );
+
+/* classic public API */
+#include "proj_api.h"
+
#endif /* ndef PROJ_INTERNAL_H */
diff --git a/src/proj_mdist.cpp b/src/proj_mdist.cpp
index e3f0f5c6..d15a692c 100644
--- a/src/proj_mdist.cpp
+++ b/src/proj_mdist.cpp
@@ -32,7 +32,8 @@
#include <math.h>
#include <stdlib.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#define MAX_ITER 20
#define TOL 1e-14
diff --git a/src/projections/aea.cpp b/src/projections/aea.cpp
index c4a4a72a..9a0c4656 100644
--- a/src/projections/aea.cpp
+++ b/src/projections/aea.cpp
@@ -30,7 +30,7 @@
#define PJ_LIB__
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -99,8 +99,8 @@ static PJ *destructor (PJ *P, int errlev) { /* Destructor
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
Q->rho = Q->c - (Q->ellips ? Q->n * pj_qsfn(sin(lp.phi), P->e, P->one_es) : Q->n2 * sin(lp.phi));;
if (Q->rho < 0.) {
@@ -114,8 +114,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoid/spheroid, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoid/spheroid, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoid/spheroid, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if( (Q->rho = hypot(xy.x, xy.y = Q->rho0 - xy.y)) != 0.0 ) {
if (Q->n < 0.) {
diff --git a/src/projections/aeqd.cpp b/src/projections/aeqd.cpp
index 1a350d90..8566062d 100644
--- a/src/projections/aeqd.cpp
+++ b/src/projections/aeqd.cpp
@@ -29,7 +29,7 @@
#include "geodesic.h"
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -75,8 +75,8 @@ static PJ *destructor (PJ *P, int errlev) { /* Destructor
-static XY e_guam_fwd(LP lp, PJ *P) { /* Guam elliptical */
- XY xy = {0.0,0.0};
+static PJ_XY e_guam_fwd(PJ_LP lp, PJ *P) { /* Guam elliptical */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, sinphi, t;
@@ -91,8 +91,8 @@ static XY e_guam_fwd(LP lp, PJ *P) { /* Guam elliptical */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi, rho;
double azi1, azi2, s12;
@@ -130,8 +130,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -177,8 +177,8 @@ oblcon:
}
-static LP e_guam_inv(XY xy, PJ *P) { /* Guam elliptical */
- LP lp = {0.0,0.0};
+static PJ_LP e_guam_inv(PJ_XY xy, PJ *P) { /* Guam elliptical */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double x2, t = 0.0;
int i;
@@ -195,8 +195,8 @@ static LP e_guam_inv(XY xy, PJ *P) { /* Guam elliptical */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
double azi1, azi2, s12, x2, y2, lat1, lon1, lat2, lon2;
@@ -227,8 +227,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosc, c_rh, sinc;
diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp
index 0eb5efd7..f7068061 100644
--- a/src/projections/airy.cpp
+++ b/src/projections/airy.cpp
@@ -29,7 +29,7 @@
#define PJ_LIB__
#include "proj.h"
#include <errno.h>
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(airy, "Airy") "\n\tMisc Sph, no inv\n\tno_cut lat_b=";
@@ -58,8 +58,8 @@ struct pj_opaque {
# define EPS 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinlam, coslam, cosphi, sinphi, t, s, Krho, cosz;
diff --git a/src/projections/aitoff.cpp b/src/projections/aitoff.cpp
index effd2c29..127841ff 100644
--- a/src/projections/aitoff.cpp
+++ b/src/projections/aitoff.cpp
@@ -34,7 +34,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
@@ -62,8 +62,8 @@ FORWARD(s_forward); /* spheroid */
#endif
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, d;
@@ -100,8 +100,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
*
************************************************************************************/
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int iter, MAXITER = 10, round = 0, MAXROUND = 20;
double EPSILON = 1e-12, D, C, f1, f2, f1p, f1l, f2p, f2l, dp, dl, sl, sp, cp, cl, x, y;
diff --git a/src/projections/august.cpp b/src/projections/august.cpp
index b5a21ef7..3523034e 100644
--- a/src/projections/august.cpp
+++ b/src/projections/august.cpp
@@ -2,14 +2,15 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(august, "August Epicycloidal") "\n\tMisc Sph, no inv";
#define M 1.333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double t, c1, c, x1, x12, y1, y12;
(void) P;
diff --git a/src/projections/bacon.cpp b/src/projections/bacon.cpp
index 6c6350fe..c713a989 100644
--- a/src/projections/bacon.cpp
+++ b/src/projections/bacon.cpp
@@ -4,7 +4,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
@@ -19,8 +20,8 @@ PROJ_HEAD(ortel, "Ortelius Oval") "\n\tMisc Sph, no inv";
PROJ_HEAD(bacon, "Bacon Globular") "\n\tMisc Sph, no inv";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double ax, f;
diff --git a/src/projections/bertin1953.cpp b/src/projections/bertin1953.cpp
index 2203d6f1..96de6d4b 100644
--- a/src/projections/bertin1953.cpp
+++ b/src/projections/bertin1953.cpp
@@ -16,7 +16,7 @@
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(bertin1953, "Bertin 1953")
"\n\tMisc Sph no inv.";
@@ -28,8 +28,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double fu = 1.4, k = 12., w = 1.68, d;
diff --git a/src/projections/bipc.cpp b/src/projections/bipc.cpp
index 19a6bbe1..5cfef11f 100644
--- a/src/projections/bipc.cpp
+++ b/src/projections/bipc.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(bipc, "Bipolar conic of western hemisphere") "\n\tConic Sph";
@@ -36,8 +36,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cphi, sphi, tphi, t, al, Az, z, Av, cdlam, sdlam, r;
int tag;
@@ -113,8 +113,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, r, rp, rl, al, z = 0.0, fAz, Az, s, c, Av;
int neg, i;
diff --git a/src/projections/boggs.cpp b/src/projections/boggs.cpp
index 119357c0..5502d493 100644
--- a/src/projections/boggs.cpp
+++ b/src/projections/boggs.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph";
# define NITER 20
@@ -11,8 +12,8 @@ PROJ_HEAD(boggs, "Boggs Eumorphic") "\n\tPCyl, no inv, Sph";
# define FYC 0.49931
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double theta, th1, c;
int i;
(void) P;
diff --git a/src/projections/bonne.cpp b/src/projections/bonne.cpp
index 385c1c4b..0e9bae79 100644
--- a/src/projections/bonne.cpp
+++ b/src/projections/bonne.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -20,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, E, c;
@@ -33,8 +33,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double E, rh;
@@ -48,8 +48,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh;
@@ -67,8 +67,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, rh;
diff --git a/src/projections/calcofi.cpp b/src/projections/calcofi.cpp
index e81e4d2a..e81843b4 100644
--- a/src/projections/calcofi.cpp
+++ b/src/projections/calcofi.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_api.h"
PROJ_HEAD(calcofi,
@@ -35,8 +35,8 @@ whatever ellipsoid is provided. */
#define ROTATION_ANGLE 0.52359877559829882 /*CalCOFI angle of 30 deg in rad */
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
double oy; /* pt O y value in Mercator */
double l1; /* l1 and l2 are distances calculated using trig that sum
to the east/west distance between point O and point xy */
@@ -67,8 +67,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double oy;
double l1;
double l2;
@@ -93,8 +93,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double ry; /* y value of point r */
double oymctr; /* Mercator-transformed y value of point O */
double rymctr; /* Mercator-transformed ry */
@@ -116,8 +116,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double ry;
double oymctr;
double rymctr;
diff --git a/src/projections/cass.cpp b/src/projections/cass.cpp
index c831558c..ee050548 100644
--- a/src/projections/cass.cpp
+++ b/src/projections/cass.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(cass, "Cassini") "\n\tCyl, Sph&Ell";
@@ -24,9 +25,9 @@ struct pj_opaque {
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
double n, t, a1, c, a2, tn;
- XY xy = {0.0, 0.0};
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = pj_mlfn (lp.phi, n = sin (lp.phi), c = cos (lp.phi), Q->en);
@@ -46,17 +47,17 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
xy.x = asin (cos (lp.phi) * sin (lp.lam));
xy.y = atan2 (tan (lp.phi), cos (lp.lam)) - P->phi0;
return xy;
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
double n, t, r, dd, d2, tn, ph1;
- LP lp = {0.0, 0.0};
+ PJ_LP lp = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
ph1 = pj_inv_mlfn (P->ctx, Q->m0 + xy.y, P->es, Q->en);
@@ -75,8 +76,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double dd;
lp.phi = asin(sin(dd = xy.y + P->phi0) * cos(xy.x));
lp.lam = atan2(tan(xy.x), cos(dd));
diff --git a/src/projections/cc.cpp b/src/projections/cc.cpp
index 152e6e4a..559a4f1a 100644
--- a/src/projections/cc.cpp
+++ b/src/projections/cc.cpp
@@ -3,14 +3,14 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(cc, "Central Cylindrical") "\n\tCyl, Sph";
#define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs (fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -21,8 +21,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = atan(xy.y);
lp.lam = xy.x;
diff --git a/src/projections/ccon.cpp b/src/projections/ccon.cpp
index 4f7dedb4..5f5128cf 100644
--- a/src/projections/ccon.cpp
+++ b/src/projections/ccon.cpp
@@ -23,7 +23,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
#define EPS10 1e-10
@@ -43,8 +43,8 @@ PROJ_HEAD(ccon, "Central Conic")
-static XY forward (LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+static PJ_XY forward (PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r;
@@ -56,8 +56,8 @@ static XY forward (LP lp, PJ *P) {
}
-static LP inverse (XY xy, PJ *P) {
- LP lp = {0.0,0.0};
+static PJ_LP inverse (PJ_XY xy, PJ *P) {
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = Q->ctgphi1 - xy.y;
diff --git a/src/projections/cea.cpp b/src/projections/cea.cpp
index f8275b62..a1c9c8b5 100644
--- a/src/projections/cea.cpp
+++ b/src/projections/cea.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -17,32 +17,32 @@ PROJ_HEAD(cea, "Equal Area Cylindrical") "\n\tCyl, Sph&Ell\n\tlat_ts=";
# define EPS 1e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
xy.y = 0.5 * pj_qsfn (sin (lp.phi), P->e, P->one_es) / P->k0;
return xy;
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = P->k0 * lp.lam;
xy.y = sin(lp.phi) / P->k0;
return xy;
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = pj_authlat(asin( 2. * xy.y * P->k0 / static_cast<struct pj_opaque*>(P->opaque)->qp), static_cast<struct pj_opaque*>(P->opaque)->apa);
lp.lam = xy.x / P->k0;
return lp;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
if ((t = fabs(xy.y *= P->k0)) - EPS <= 1.) {
diff --git a/src/projections/chamb.cpp b/src/projections/chamb.cpp
index a490e817..33a38781 100644
--- a/src/projections/chamb.cpp
+++ b/src/projections/chamb.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
typedef struct { double r, Az; } VECT;
namespace { // anonymous namespace
@@ -13,10 +13,10 @@ struct pj_opaque {
double phi, lam;
double cosphi, sinphi;
VECT v;
- XY p;
+ PJ_XY p;
double Az;
} c[3];
- XY p;
+ PJ_XY p;
double beta_0, beta_1, beta_2;
};
} // anonymous namespace
@@ -54,8 +54,8 @@ static double lc(projCtx ctx, double b,double c,double a) {
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinphi, cosphi, a;
VECT v[3];
diff --git a/src/projections/collg.cpp b/src/projections/collg.cpp
index 7904de29..b22e1bf2 100644
--- a/src/projections/collg.cpp
+++ b/src/projections/collg.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph";
#define FXC 1.12837916709551257390
@@ -11,8 +11,8 @@ PROJ_HEAD(collg, "Collignon") "\n\tPCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
if ((xy.y = 1. - sin(lp.phi)) <= 0.)
xy.y = 0.;
@@ -24,8 +24,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / FYC - 1.;
if (fabs(lp.phi = 1. - lp.phi * lp.phi) < 1.)
lp.phi = asin(lp.phi);
diff --git a/src/projections/comill.cpp b/src/projections/comill.cpp
index b6e0192e..3af19b42 100644
--- a/src/projections/comill.cpp
+++ b/src/projections/comill.cpp
@@ -10,7 +10,8 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(comill, "Compact Miller") "\n\tCyl, Sph";
@@ -25,8 +26,8 @@ PROJ_HEAD(comill, "Compact Miller") "\n\tCyl, Sph";
/* Not sure at all of the appropriate number for MAX_ITER... */
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double lat_sq;
(void) P; /* silence unused parameter warnings */
@@ -38,8 +39,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, f, fder;
int i;
diff --git a/src/projections/crast.cpp b/src/projections/crast.cpp
index 4e4dee8b..35272058 100644
--- a/src/projections/crast.cpp
+++ b/src/projections/crast.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
#define THIRD 0.333333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
lp.phi *= THIRD;
xy.x = XM * lp.lam * (2. * cos(lp.phi + lp.phi) - 1.);
@@ -22,8 +23,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = 3. * asin(xy.y * RYM);
lp.lam = xy.x * RXM / (2. * cos((lp.phi + lp.phi) * THIRD) - 1);
diff --git a/src/projections/denoy.cpp b/src/projections/denoy.cpp
index 5c337c45..1560ad6b 100644
--- a/src/projections/denoy.cpp
+++ b/src/projections/denoy.cpp
@@ -1,7 +1,8 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl, no inv, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(denoy, "Denoyer Semi-Elliptical") "\n\tPCyl, no inv, Sph";
#define D5 0.03
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
(void) P;
xy.y = lp.phi;
xy.x = lp.lam;
diff --git a/src/projections/eck1.cpp b/src/projections/eck1.cpp
index 88a7430c..3a19796e 100644
--- a/src/projections/eck1.cpp
+++ b/src/projections/eck1.cpp
@@ -1,15 +1,16 @@
#define PJ_LIB__
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck1, "Eckert I") "\n\tPCyl, Sph";
#define FC 0.92131773192356127802
#define RP 0.31830988618379067154
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = FC * lp.lam * (1. - RP * fabs(lp.phi));
@@ -19,8 +20,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = xy.y / FC;
diff --git a/src/projections/eck2.cpp b/src/projections/eck2.cpp
index f76ab4ec..f019fdab 100644
--- a/src/projections/eck2.cpp
+++ b/src/projections/eck2.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl, Sph";
@@ -13,8 +13,8 @@ PROJ_HEAD(eck2, "Eckert II") "\n\tPCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = FXC * lp.lam * (xy.y = sqrt(4. - 3. * sin(fabs(lp.phi))));
@@ -25,8 +25,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = xy.x / (FXC * ( lp.phi = 2. - fabs(xy.y) / FYC) );
diff --git a/src/projections/eck3.cpp b/src/projections/eck3.cpp
index 90376631..6777c765 100644
--- a/src/projections/eck3.cpp
+++ b/src/projections/eck3.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck3, "Eckert III") "\n\tPCyl, Sph";
PROJ_HEAD(putp1, "Putnins P1") "\n\tPCyl, Sph";
@@ -17,8 +18,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = Q->C_y * lp.phi;
@@ -27,8 +28,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double denominator;
diff --git a/src/projections/eck4.cpp b/src/projections/eck4.cpp
index 4fa4c21f..7f8203b2 100644
--- a/src/projections/eck4.cpp
+++ b/src/projections/eck4.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph";
@@ -15,8 +16,8 @@ PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph";
#define NITER 6
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double p, V, s, c;
int i;
(void) P;
@@ -43,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double c;
lp.phi = aasin(P->ctx,xy.y * RC_y);
diff --git a/src/projections/eck5.cpp b/src/projections/eck5.cpp
index f9f28460..40e9d3bb 100644
--- a/src/projections/eck5.cpp
+++ b/src/projections/eck5.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(eck5, "Eckert V") "\n\tPCyl, Sph";
#define RYF 1.13375401361911319568
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = XF * (1. + cos(lp.phi)) * lp.lam;
xy.y = YF * lp.phi;
@@ -22,8 +23,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = RXF * xy.x / (1. + cos( lp.phi = RYF * xy.y));
diff --git a/src/projections/eqc.cpp b/src/projections/eqc.cpp
index 3fdb6dc0..eb021eac 100644
--- a/src/projections/eqc.cpp
+++ b/src/projections/eqc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -16,8 +16,8 @@ PROJ_HEAD(eqc, "Equidistant Cylindrical (Plate Carree)")
"\n\tCyl, Sph\n\tlat_ts=[, lat_0=0]";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.x = Q->rc * lp.lam;
@@ -27,8 +27,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.lam = xy.x / Q->rc;
diff --git a/src/projections/eqdc.cpp b/src/projections/eqdc.cpp
index 0831fca4..d175d4a1 100644
--- a/src/projections/eqdc.cpp
+++ b/src/projections/eqdc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -25,8 +25,8 @@ PROJ_HEAD(eqdc, "Equidistant Conic")
# define EPS10 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
Q->rho = Q->c - (Q->ellips ? pj_mlfn(lp.phi, sin(lp.phi),
@@ -38,8 +38,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if ((Q->rho = hypot(xy.x, xy.y = Q->rho0 - xy.y)) != 0.0 ) {
diff --git a/src/projections/eqearth.cpp b/src/projections/eqearth.cpp
index e5c1f974..dc58eed9 100644
--- a/src/projections/eqearth.cpp
+++ b/src/projections/eqearth.cpp
@@ -16,7 +16,8 @@ Added ellipsoidal equations by Bojan Savric, 22 August 2018
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(eqearth, "Equal Earth") "\n\tPCyl, Sph&Ell";
@@ -39,8 +40,8 @@ struct pj_opaque {
};
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sbeta;
double psi, psi2, psi6;
@@ -73,8 +74,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal/spheroidal, forwar
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal/spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal/spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double yc, y2, y6;
int i;
diff --git a/src/projections/etmerc.cpp b/src/projections/etmerc.cpp
index 05f86f37..e75bc168 100644
--- a/src/projections/etmerc.cpp
+++ b/src/projections/etmerc.cpp
@@ -43,7 +43,7 @@
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -145,8 +145,8 @@ static double clens(double *a, int size, double arg_r) {
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
double Cn = lp.phi, Ce = lp.lam;
@@ -181,8 +181,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
double Cn = xy.y, Ce = xy.x;
diff --git a/src/projections/fahey.cpp b/src/projections/fahey.cpp
index 85e0ab69..ba8cb8f9 100644
--- a/src/projections/fahey.cpp
+++ b/src/projections/fahey.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(fahey, "Fahey") "\n\tPcyl, Sph";
#define TOL 1e-6
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = tan(0.5 * lp.phi);
@@ -20,8 +21,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
xy.y /= 1.819152;
diff --git a/src/projections/fouc_s.cpp b/src/projections/fouc_s.cpp
index c5e711de..e91f41c3 100644
--- a/src/projections/fouc_s.cpp
+++ b/src/projections/fouc_s.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(fouc_s, "Foucaut Sinusoidal") "\n\tPCyl, Sph";
@@ -18,8 +18,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
@@ -30,8 +30,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double V;
int i;
diff --git a/src/projections/gall.cpp b/src/projections/gall.cpp
index a8697482..8f1ca1f8 100644
--- a/src/projections/gall.cpp
+++ b/src/projections/gall.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(gall, "Gall (Gall Stereographic)") "\n\tCyl, Sph";
#define RXF 1.41421356237309504880
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = XF * lp.lam;
@@ -23,8 +24,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = RXF * xy.x;
diff --git a/src/projections/geos.cpp b/src/projections/geos.cpp
index 90fb01ab..cdb0244a 100644
--- a/src/projections/geos.cpp
+++ b/src/projections/geos.cpp
@@ -33,7 +33,7 @@
#include <stddef.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -52,8 +52,8 @@ struct pj_opaque {
PROJ_HEAD(geos, "Geostationary Satellite View") "\n\tAzi, Sph&Ell\n\th=";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, tmp;
@@ -82,8 +82,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r, Vx, Vy, Vz, tmp;
@@ -118,8 +118,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, a, b, det, k;
@@ -155,8 +155,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Vx, Vy, Vz, a, b, det, k;
diff --git a/src/projections/gins8.cpp b/src/projections/gins8.cpp
index cc422437..6f499889 100644
--- a/src/projections/gins8.cpp
+++ b/src/projections/gins8.cpp
@@ -1,5 +1,7 @@
#define PJ_LIB__
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph, no inv";
@@ -8,8 +10,8 @@ PROJ_HEAD(gins8, "Ginsburg VIII (TsNIIGAiK)") "\n\tPCyl, Sph, no inv";
#define C12 0.08333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double t = lp.phi * lp.phi;
(void) P;
diff --git a/src/projections/gn_sinu.cpp b/src/projections/gn_sinu.cpp
index 530de229..3a591669 100644
--- a/src/projections/gn_sinu.cpp
+++ b/src/projections/gn_sinu.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(gn_sinu, "General Sinusoidal Series") "\n\tPCyl, Sph\n\tm= n=";
PROJ_HEAD(sinu, "Sinusoidal (Sanson-Flamsteed)") "\n\tPCyl, Sph&Ell";
@@ -23,8 +23,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
double s, c;
xy.y = pj_mlfn(lp.phi, s = sin(lp.phi), c = cos(lp.phi), static_cast<struct pj_opaque*>(P->opaque)->en);
@@ -33,8 +33,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double s;
if ((s = fabs(lp.phi = pj_inv_mlfn(P->ctx, xy.y, P->es, static_cast<struct pj_opaque*>(P->opaque)->en))) < M_HALFPI) {
@@ -50,8 +50,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (Q->m == 0.0)
@@ -80,8 +80,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y /= Q->C_y;
diff --git a/src/projections/gnom.cpp b/src/projections/gnom.cpp
index a4b5e35d..bf454ba9 100644
--- a/src/projections/gnom.cpp
+++ b/src/projections/gnom.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(gnom, "Gnomonic") "\n\tAzi, Sph";
@@ -29,8 +29,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -77,8 +77,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosz, sinz;
diff --git a/src/projections/goode.cpp b/src/projections/goode.cpp
index c79d125e..802df90c 100644
--- a/src/projections/goode.cpp
+++ b/src/projections/goode.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(goode, "Goode Homolosine") "\n\tPCyl, Sph";
@@ -21,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (fabs(lp.phi) <= PHI_LIM)
@@ -35,8 +35,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp;
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
if (fabs(xy.y) <= PHI_LIM)
diff --git a/src/projections/gstmerc.cpp b/src/projections/gstmerc.cpp
index 9b819bac..735d39e5 100644
--- a/src/projections/gstmerc.cpp
+++ b/src/projections/gstmerc.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(gstmerc, "Gauss-Schreiber Transverse Mercator (aka Gauss-Laborde Reunion)")
"\n\tCyl, Sph&Ell\n\tlat_0= lon_0= k_0=";
@@ -21,8 +22,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double L, Ls, sinLs1, Ls1;
@@ -37,8 +38,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double L, LC, sinC;
diff --git a/src/projections/hammer.cpp b/src/projections/hammer.cpp
index d4caa656..aa7d1ba9 100644
--- a/src/projections/hammer.cpp
+++ b/src/projections/hammer.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
"\n\tMisc Sph, \n\tW= M=";
@@ -19,8 +19,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, d;
@@ -31,8 +31,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double z;
diff --git a/src/projections/hatano.cpp b/src/projections/hatano.cpp
index 019671cc..b2ef6c6f 100644
--- a/src/projections/hatano.cpp
+++ b/src/projections/hatano.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph";
@@ -22,8 +22,8 @@ PROJ_HEAD(hatano, "Hatano Asymmetrical Equal Area") "\n\tPCyl, Sph";
#define RXC 1.17647058823529411764
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double th1, c;
int i;
(void) P;
@@ -40,8 +40,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double th;
th = xy.y * ( xy.y < 0. ? RYCS : RYCN);
diff --git a/src/projections/healpix.cpp b/src/projections/healpix.cpp
index 7f0b3e83..8e4846ed 100644
--- a/src/projections/healpix.cpp
+++ b/src/projections/healpix.cpp
@@ -1,6 +1,6 @@
/******************************************************************************
* Project: PROJ.4
- * Purpose: Implementation of the HEALPix and rHEALPix projections.
+ * Purpose: Implementation of the HEAPJ_LPix and rHEAPJ_LPix projections.
* For background see <http://code.scenzgrid.org/index.php/p/scenzgrid-py/source/tree/master/docs/rhealpix_dggs.pdf>.
* Authors: Alex Raichev (raichev@cs.auckland.ac.nz)
* Michael Speth (spethm@landcareresearch.co.nz)
@@ -35,10 +35,10 @@
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
-PROJ_HEAD(healpix, "HEALPix") "\n\tSph&Ell";
-PROJ_HEAD(rhealpix, "rHEALPix") "\n\tSph&Ell\n\tnorth_square= south_square=";
+PROJ_HEAD(healpix, "HEAPJ_LPix") "\n\tSph&Ell";
+PROJ_HEAD(rhealpix, "rHEAPJ_LPix") "\n\tSph&Ell\n\tnorth_square= south_square=";
/* Matrix for counterclockwise rotation by pi/2: */
# define R1 {{ 0,-1},{ 1, 0}}
@@ -116,7 +116,7 @@ static int pnpoly(int nvert, double vert[][2], double testx, double testy) {
int i;
int counter = 0;
double xinters;
- XY p1, p2;
+ PJ_XY p1, p2;
/* Check for boundrary cases */
for (i = 0; i < nvert; i++) {
@@ -153,10 +153,10 @@ static int pnpoly(int nvert, double vert[][2], double testx, double testy) {
/**
* Return 1 if (x, y) lies in (the interior or boundary of) the image of the
- * HEALPix projection (in case proj=0) or in the image the rHEALPix projection
+ * HEAPJ_LPix projection (in case proj=0) or in the image the rHEAPJ_LPix projection
* (in case proj=1), and return 0 otherwise.
- * @param north_square the position of the north polar square (rHEALPix only)
- * @param south_square the position of the south polar square (rHEALPix only)
+ * @param north_square the position of the north polar square (rHEAPJ_LPix only)
+ * @param south_square the position of the south polar square (rHEAPJ_LPix only)
**/
static int in_image(double x, double y, int proj, int north_square,
int south_square) {
@@ -251,14 +251,14 @@ static double auth_lat(PJ *P, double alpha, int inverse) {
/**
- * Return the HEALPix projection of the longitude-latitude point lp on
+ * Return the HEAPJ_LPix projection of the longitude-latitude point lp on
* the unit sphere.
**/
-static XY healpix_sphere(LP lp) {
+static PJ_XY healpix_sphere(PJ_LP lp) {
double lam = lp.lam;
double phi = lp.phi;
double phi0 = asin(2.0/3.0);
- XY xy;
+ PJ_XY xy;
/* equatorial region */
if ( fabs(phi) <= phi0) {
@@ -282,8 +282,8 @@ static XY healpix_sphere(LP lp) {
/**
* Return the inverse of healpix_sphere().
**/
-static LP healpix_sphere_inverse(XY xy) {
- LP lp;
+static PJ_LP healpix_sphere_inverse(PJ_XY xy) {
+ PJ_LP lp;
double x = xy.x;
double y = xy.y;
double y0 = M_FORTPI;
@@ -354,10 +354,10 @@ static void dot_product(const double a[2][2], const double b[2], double *ret) {
/**
* Return the number of the polar cap, the pole point coordinates, and
* the region that (x, y) lies in.
- * If inverse=0, then assume (x,y) lies in the image of the HEALPix
+ * If inverse=0, then assume (x,y) lies in the image of the HEAPJ_LPix
* projection of the unit sphere.
* If inverse=1, then assume (x,y) lies in the image of the
- * (north_square, south_square)-rHEALPix projection of the unit sphere.
+ * (north_square, south_square)-rHEAPJ_LPix projection of the unit sphere.
**/
static CapMap get_cap(double x, double y, int north_square, int south_square,
int inverse) {
@@ -412,8 +412,8 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
capmap.cn = 0;
return capmap;
}
- /* Polar Region, find the HEALPix polar cap number that
- x, y moves to when rHEALPix polar square is disassembled. */
+ /* Polar Region, find the HEAPJ_LPix polar cap number that
+ x, y moves to when rHEAPJ_LPix polar square is disassembled. */
if (capmap.region == CapMap::north) {
if (y >= -x - M_FORTPI - EPS && y < x + 5*M_FORTPI - EPS) {
capmap.cn = (north_square + 1) % 4;
@@ -441,7 +441,7 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
/**
- * Rearrange point (x, y) in the HEALPix projection by
+ * Rearrange point (x, y) in the HEAPJ_LPix projection by
* combining the polar caps into two polar squares.
* Put the north polar square in position north_square and
* the south polar square in position south_square.
@@ -449,9 +449,9 @@ static CapMap get_cap(double x, double y, int north_square, int south_square,
* @param north_square integer between 0 and 3.
* @param south_square integer between 0 and 3.
**/
-static XY combine_caps(double x, double y, int north_square, int south_square,
+static PJ_XY combine_caps(double x, double y, int north_square, int south_square,
int inverse) {
- XY xy;
+ PJ_XY xy;
double v[2];
double c[2];
double vector[2];
@@ -512,22 +512,22 @@ static XY combine_caps(double x, double y, int north_square, int south_square,
}
-static XY s_healpix_forward(LP lp, PJ *P) { /* sphere */
+static PJ_XY s_healpix_forward(PJ_LP lp, PJ *P) { /* sphere */
(void) P;
return healpix_sphere(lp);
}
-static XY e_healpix_forward(LP lp, PJ *P) { /* ellipsoid */
+static PJ_XY e_healpix_forward(PJ_LP lp, PJ *P) { /* ellipsoid */
lp.phi = auth_lat(P, lp.phi, 0);
return healpix_sphere(lp);
}
-static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
- /* Check whether (x, y) lies in the HEALPix image */
+static PJ_LP s_healpix_inverse(PJ_XY xy, PJ *P) { /* sphere */
+ /* Check whether (x, y) lies in the HEAPJ_LPix image */
if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
- LP lp;
+ PJ_LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
@@ -537,10 +537,10 @@ static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
}
-static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
- LP lp = {0.0,0.0};
+static PJ_LP e_healpix_inverse(PJ_XY xy, PJ *P) { /* ellipsoid */
+ PJ_LP lp = {0.0,0.0};
- /* Check whether (x, y) lies in the HEALPix image. */
+ /* Check whether (x, y) lies in the HEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
@@ -553,29 +553,29 @@ static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
}
-static XY s_rhealpix_forward(LP lp, PJ *P) { /* sphere */
+static PJ_XY s_rhealpix_forward(PJ_LP lp, PJ *P) { /* sphere */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy = healpix_sphere(lp);
+ PJ_XY xy = healpix_sphere(lp);
return combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 0);
}
-static XY e_rhealpix_forward(LP lp, PJ *P) { /* ellipsoid */
+static PJ_XY e_rhealpix_forward(PJ_LP lp, PJ *P) { /* ellipsoid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy;
+ PJ_XY xy;
lp.phi = auth_lat(P, lp.phi, 0);
xy = healpix_sphere(lp);
return combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 0);
}
-static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
+static PJ_LP s_rhealpix_inverse(PJ_XY xy, PJ *P) { /* sphere */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- /* Check whether (x, y) lies in the rHEALPix image. */
+ /* Check whether (x, y) lies in the rHEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
- LP lp;
+ PJ_LP lp;
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
pj_ctx_set_errno(P->ctx, PJD_ERR_INVALID_X_OR_Y);
@@ -586,11 +586,11 @@ static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
}
-static LP e_rhealpix_inverse(XY xy, PJ *P) { /* ellipsoid */
+static PJ_LP e_rhealpix_inverse(PJ_XY xy, PJ *P) { /* ellipsoid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
- /* Check whether (x, y) lies in the rHEALPix image. */
+ /* Check whether (x, y) lies in the rHEAPJ_LPix image. */
if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
lp.lam = HUGE_VAL;
lp.phi = HUGE_VAL;
diff --git a/src/projections/igh.cpp b/src/projections/igh.cpp
index e3576861..a8efbb9d 100644
--- a/src/projections/igh.cpp
+++ b/src/projections/igh.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(igh, "Interrupted Goode Homolosine") "\n\tPCyl, Sph";
@@ -40,8 +41,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int z;
@@ -73,8 +74,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
const double y90 = Q->dy0 + sqrt(2); /* lt=90 corresponds to y=y0+sqrt(2) */
@@ -184,8 +185,8 @@ static PJ *destructor (PJ *P, int errlev) {
PJ *PROJECTION(igh) {
- XY xy1, xy3;
- LP lp = { 0, d4044118 };
+ PJ_XY xy1, xy3;
+ PJ_LP lp = { 0, d4044118 };
struct pj_opaque *Q = static_cast<struct pj_opaque*>(pj_calloc (1, sizeof (struct pj_opaque)));
if (nullptr==Q)
return pj_default_destructor (P, ENOMEM);
diff --git a/src/projections/imw_p.cpp b/src/projections/imw_p.cpp
index 012c5caa..723fcc48 100644
--- a/src/projections/imw_p.cpp
+++ b/src/projections/imw_p.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(imw_p, "International Map of the World Polyconic")
"\n\tMod. Polyconic, Ell\n\tlat_1= and lat_2= [lon_1=]";
@@ -48,9 +48,9 @@ static int phi12(PJ *P, double *del, double *sig) {
}
-static XY loc_for(LP lp, PJ *P, double *yc) {
+static PJ_XY loc_for(PJ_LP lp, PJ *P, double *yc) {
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy;
+ PJ_XY xy;
if (lp.phi == 0.0) {
xy.x = lp.lam;
@@ -97,17 +97,17 @@ static XY loc_for(LP lp, PJ *P, double *yc) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
double yc;
- XY xy = loc_for(lp, P, &yc);
+ PJ_XY xy = loc_for(lp, P, &yc);
return (xy);
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY t;
+ PJ_XY t;
double yc = 0.0;
int i = 0;
const int N_MAX_ITER = 1000; /* Arbitrarily chosen number... */
diff --git a/src/projections/isea.cpp b/src/projections/isea.cpp
index 522e6813..3a0a0a48 100644
--- a/src/projections/isea.cpp
+++ b/src/projections/isea.cpp
@@ -14,7 +14,7 @@
#include "proj_internal.h"
#include "proj_math.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#define DEG36 0.62831853071795864768
#define DEG72 1.25663706143591729537
@@ -995,8 +995,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
struct isea_pt out;
struct isea_geo in;
diff --git a/src/projections/krovak.cpp b/src/projections/krovak.cpp
index 9ecffb89..591f8dcc 100644
--- a/src/projections/krovak.cpp
+++ b/src/projections/krovak.cpp
@@ -80,7 +80,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(krovak, "Krovak") "\n\tPCyl, Ell";
@@ -102,9 +103,9 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- XY xy = {0.0,0.0};
+ PJ_XY xy = {0.0,0.0};
double gfi, u, deltav, s, d, eps, rho;
@@ -129,9 +130,9 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
double u, deltav, s, d, eps, rho, fi1, xy0;
int i;
diff --git a/src/projections/labrd.cpp b/src/projections/labrd.cpp
index d3930243..330c105f 100644
--- a/src/projections/labrd.cpp
+++ b/src/projections/labrd.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(labrd, "Laborde") "\n\tCyl, Sph\n\tSpecial for Madagascar";
#define EPS 1.e-10
@@ -15,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double V1, V2, ps, sinps, cosps, sinps2, cosps2;
double I1, I2, I3, I4, I5, I6, x2, y2, t;
@@ -48,8 +49,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
/* t = 0.0 optimization is to avoid a false positive cppcheck warning */
/* (cppcheck git beaf29c15867984aa3c2a15cf15bd7576ccde2b3). Might no */
diff --git a/src/projections/laea.cpp b/src/projections/laea.cpp
index dd02c75a..e3c7248a 100644
--- a/src/projections/laea.cpp
+++ b/src/projections/laea.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(laea, "Lambert Azimuthal Equal Area") "\n\tAzi, Sph&Ell";
@@ -32,8 +32,8 @@ struct pj_opaque {
#define EPS10 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinlam, sinphi, q, sinb=0.0, cosb=0.0, b=0.0;
@@ -94,8 +94,8 @@ eqcon:
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -136,8 +136,8 @@ oblcon:
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cCe, sCe, q, rho, ab=0.0;
@@ -185,8 +185,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosz=0.0, rh, sinz=0.0;
diff --git a/src/projections/lagrng.cpp b/src/projections/lagrng.cpp
index a119ea31..65686584 100644
--- a/src/projections/lagrng.cpp
+++ b/src/projections/lagrng.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lagrng, "Lagrange") "\n\tMisc Sph\n\tW=";
@@ -21,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double v, c;
@@ -45,8 +45,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, x2, y2p, y2m;
diff --git a/src/projections/larr.cpp b/src/projections/larr.cpp
index e4d5d240..bab1dbf4 100644
--- a/src/projections/larr.cpp
+++ b/src/projections/larr.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(larr, "Larrivee") "\n\tMisc Sph, no inv";
#define SIXTH .16666666666666666
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = 0.5 * lp.lam * (1. + sqrt(cos(lp.phi)));
diff --git a/src/projections/lask.cpp b/src/projections/lask.cpp
index 46f23edb..c4c6734d 100644
--- a/src/projections/lask.cpp
+++ b/src/projections/lask.cpp
@@ -1,5 +1,7 @@
#define PJ_LIB__
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv";
@@ -15,8 +17,8 @@ PROJ_HEAD(lask, "Laskowski") "\n\tMisc Sph, no inv";
#define b05 -0.0491032
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double l2, p2;
(void) P;
diff --git a/src/projections/latlong.cpp b/src/projections/latlong.cpp
index 1331d59a..f114504b 100644
--- a/src/projections/latlong.cpp
+++ b/src/projections/latlong.cpp
@@ -30,7 +30,7 @@
/* very loosely based upon DMA code by Bradford W. Drew */
#define PJ_LIB__
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t";
PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t";
@@ -38,8 +38,8 @@ PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") "\n\t";
PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t";
- static XY latlong_forward(LP lp, PJ *P) {
- XY xy = {0.0,0.0};
+ static PJ_XY latlong_forward(PJ_LP lp, PJ *P) {
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = lp.lam;
xy.y = lp.phi;
@@ -47,8 +47,8 @@ PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t";
}
-static LP latlong_inverse(XY xy, PJ *P) {
- LP lp = {0.0,0.0};
+static PJ_LP latlong_inverse(PJ_XY xy, PJ *P) {
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.phi = xy.y;
lp.lam = xy.x;
@@ -56,8 +56,8 @@ static LP latlong_inverse(XY xy, PJ *P) {
}
- static XYZ latlong_forward_3d (LPZ lpz, PJ *P) {
- XYZ xyz = {0,0,0};
+ static PJ_XYZ latlong_forward_3d (PJ_LPZ lpz, PJ *P) {
+ PJ_XYZ xyz = {0,0,0};
(void) P;
xyz.x = lpz.lam;
xyz.y = lpz.phi;
@@ -66,8 +66,8 @@ static LP latlong_inverse(XY xy, PJ *P) {
}
-static LPZ latlong_inverse_3d (XYZ xyz, PJ *P) {
- LPZ lpz = {0,0,0};
+static PJ_LPZ latlong_inverse_3d (PJ_XYZ xyz, PJ *P) {
+ PJ_LPZ lpz = {0,0,0};
(void) P;
lpz.lam = xyz.x;
lpz.phi = xyz.y;
diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp
index 7d6e3f57..a1fe79a9 100644
--- a/src/projections/lcc.cpp
+++ b/src/projections/lcc.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(lcc, "Lambert Conformal Conic")
@@ -20,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0., 0.};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0., 0.};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
@@ -43,8 +43,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0., 0.};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0., 0.};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
diff --git a/src/projections/lcca.cpp b/src/projections/lcca.cpp
index 70b5dff9..d4dc8641 100644
--- a/src/projections/lcca.cpp
+++ b/src/projections/lcca.cpp
@@ -51,7 +51,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative")
"\n\tConic, Sph&Ell\n\tlat_0=";
@@ -80,8 +80,8 @@ static double fSp(double S, double C) { /* deriv of fs */
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double S, r, dr;
@@ -94,8 +94,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double theta, dr, S, dif;
int i;
diff --git a/src/projections/loxim.cpp b/src/projections/loxim.cpp
index f68e844a..2a780a9e 100644
--- a/src/projections/loxim.cpp
+++ b/src/projections/loxim.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(loxim, "Loximuthal") "\n\tPCyl Sph";
@@ -19,8 +19,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y = lp.phi - Q->phi1;
@@ -37,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = xy.y + Q->phi1;
diff --git a/src/projections/lsat.cpp b/src/projections/lsat.cpp
index a0eca1bd..5b7520d3 100644
--- a/src/projections/lsat.cpp
+++ b/src/projections/lsat.cpp
@@ -5,7 +5,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(lsat, "Space oblique for LANDSAT")
"\n\tCyl, Sph&Ell\n\tlsat= path=";
@@ -44,8 +44,8 @@ static void seraz0(double lam, double mult, PJ *P) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int l, nn;
double lamt = 0.0, xlam, sdsq, c, d, s, lamdp = 0.0, phidp, lampp, tanph;
@@ -107,8 +107,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
diff --git a/src/projections/mbt_fps.cpp b/src/projections/mbt_fps.cpp
index 66ed9458..beff3314 100644
--- a/src/projections/mbt_fps.cpp
+++ b/src/projections/mbt_fps.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl, Sph";
@@ -15,8 +16,8 @@ PROJ_HEAD(mbt_fps, "McBryde-Thomas Flat-Pole Sine (No. 2)") "\n\tCyl, Sph";
#define C_y 1.44492
#define C1_2 0.33333333333333333333333333
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double k, V, t;
int i;
(void) P;
@@ -36,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
lp.phi = C2 * (t = aasin(P->ctx,xy.y / C_y));
diff --git a/src/projections/mbtfpp.cpp b/src/projections/mbtfpp.cpp
index 276a43eb..ebd860ee 100644
--- a/src/projections/mbtfpp.cpp
+++ b/src/projections/mbtfpp.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl, Sph";
@@ -15,8 +15,8 @@ PROJ_HEAD(mbtfpp, "McBride-Thomas Flat-Polar Parabolic") "\n\tCyl, Sph";
#define ONEEPS 1.0000001
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
lp.phi = asin(CS * sin(lp.phi));
@@ -26,8 +26,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / FYC;
if (fabs(lp.phi) >= 1.) {
diff --git a/src/projections/mbtfpq.cpp b/src/projections/mbtfpq.cpp
index b7c0eb16..ec49f9ce 100644
--- a/src/projections/mbtfpq.cpp
+++ b/src/projections/mbtfpq.cpp
@@ -3,7 +3,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl, Sph";
@@ -18,8 +18,8 @@ PROJ_HEAD(mbtfpq, "McBryde-Thomas Flat-Polar Quartic") "\n\tCyl, Sph";
#define RXC 3.20041258076506210122
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double th1, c;
int i;
(void) P;
@@ -36,8 +36,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t;
lp.phi = RYC * xy.y;
diff --git a/src/projections/merc.cpp b/src/projections/merc.cpp
index 1998234e..5b65de90 100644
--- a/src/projections/merc.cpp
+++ b/src/projections/merc.cpp
@@ -6,7 +6,7 @@
#include "proj_internal.h"
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(merc, "Mercator") "\n\tCyl, Sph&Ell\n\tlat_ts=";
PROJ_HEAD(webmerc, "Web Mercator / Pseudo Mercator") "\n\tCyl, Ell\n\t";
@@ -20,8 +20,8 @@ static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */
return log(tan(M_FORTPI + .5 * x));
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -32,8 +32,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return xy;
@@ -44,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
if ((lp.phi = pj_phi2(P->ctx, exp(- xy.y / P->k0), P->e)) == HUGE_VAL) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
return lp;
@@ -55,8 +55,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = atan(sinh(xy.y / P->k0));
lp.lam = xy.x / P->k0;
return lp;
diff --git a/src/projections/mill.cpp b/src/projections/mill.cpp
index 3ea9636f..5d4acd89 100644
--- a/src/projections/mill.cpp
+++ b/src/projections/mill.cpp
@@ -2,12 +2,13 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(mill, "Miller Cylindrical") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = lp.lam;
@@ -17,8 +18,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
(void) P;
lp.lam = xy.x;
diff --git a/src/projections/misrsom.cpp b/src/projections/misrsom.cpp
index c84b96e3..c53f22a1 100644
--- a/src/projections/misrsom.cpp
+++ b/src/projections/misrsom.cpp
@@ -26,7 +26,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(misrsom, "Space oblique for MISR")
"\n\tCyl, Sph&Ell\n\tpath=";
@@ -62,8 +62,8 @@ static void seraz0(double lam, double mult, PJ *P) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int l, nn;
double lamt = 0.0, xlam, sdsq, c, d, s, lamdp = 0.0, phidp, lampp, tanph;
@@ -123,8 +123,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
diff --git a/src/projections/mod_ster.cpp b/src/projections/mod_ster.cpp
index 7c4f363b..83390178 100644
--- a/src/projections/mod_ster.cpp
+++ b/src/projections/mod_ster.cpp
@@ -1,7 +1,8 @@
/* based upon Snyder and Linck, USGS-NMD */
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(mil_os, "Miller Oblated Stereographic") "\n\tAzi(mod)";
@@ -21,8 +22,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinlon, coslon, esphi, chi, schi, cchi, s;
COMPLEX p;
@@ -45,8 +46,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
int nn;
COMPLEX p, fxy, fpxy, dp;
diff --git a/src/projections/moll.cpp b/src/projections/moll.cpp
index c877a1bb..03393b01 100644
--- a/src/projections/moll.cpp
+++ b/src/projections/moll.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(moll, "Mollweide") "\n\tPCyl, Sph";
PROJ_HEAD(wag4, "Wagner IV") "\n\tPCyl, Sph";
@@ -19,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double k, V;
int i;
@@ -42,8 +43,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx, xy.y / Q->C_y);
lp.lam = xy.x / (Q->C_x * cos(lp.phi));
diff --git a/src/projections/natearth.cpp b/src/projections/natearth.cpp
index 27a6b137..d8e52c37 100644
--- a/src/projections/natearth.cpp
+++ b/src/projections/natearth.cpp
@@ -16,7 +16,8 @@ Port to PROJ.4 by Bernhard Jenny, 6 June 2011
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl, Sph";
@@ -41,8 +42,8 @@ PROJ_HEAD(natearth, "Natural Earth") "\n\tPCyl, Sph";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2, phi4;
(void) P;
@@ -54,8 +55,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, y4, f, fder;
int i;
(void) P;
diff --git a/src/projections/natearth2.cpp b/src/projections/natearth2.cpp
index f6aba671..9849a723 100644
--- a/src/projections/natearth2.cpp
+++ b/src/projections/natearth2.cpp
@@ -9,7 +9,8 @@ Port to PROJ.4 by Bojan Savric, 4 April 2016
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(natearth2, "Natural Earth 2") "\n\tPCyl, Sph";
@@ -33,8 +34,8 @@ PROJ_HEAD(natearth2, "Natural Earth 2") "\n\tPCyl, Sph";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2, phi4, phi6;
(void) P;
@@ -48,8 +49,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, y4, y6, f, fder;
int i;
(void) P;
diff --git a/src/projections/nell.cpp b/src/projections/nell.cpp
index 2a7ea32c..b6e69dd6 100644
--- a/src/projections/nell.cpp
+++ b/src/projections/nell.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nell, "Nell") "\n\tPCyl, Sph";
@@ -10,8 +11,8 @@ PROJ_HEAD(nell, "Nell") "\n\tPCyl, Sph";
#define LOOP_TOL 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double k, V;
int i;
(void) P;
@@ -32,8 +33,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.lam = 2. * xy.x / (1. + cos(xy.y));
lp.phi = aasin(P->ctx,0.5 * (xy.y + sin(xy.y)));
diff --git a/src/projections/nell_h.cpp b/src/projections/nell_h.cpp
index 28c3ace7..be28b917 100644
--- a/src/projections/nell_h.cpp
+++ b/src/projections/nell_h.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl, Sph";
@@ -10,8 +11,8 @@ PROJ_HEAD(nell_h, "Nell-Hammer") "\n\tPCyl, Sph";
#define EPS 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
xy.x = 0.5 * lp.lam * (1. + cos(lp.phi));
@@ -21,8 +22,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double V, c, p;
int i;
(void) P;
diff --git a/src/projections/nicol.cpp b/src/projections/nicol.cpp
index 541d08b2..c4bee261 100644
--- a/src/projections/nicol.cpp
+++ b/src/projections/nicol.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nicol, "Nicolosi Globular") "\n\tMisc Sph, no inv";
#define EPS 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
(void) P;
if (fabs(lp.lam) < EPS) {
diff --git a/src/projections/nsper.cpp b/src/projections/nsper.cpp
index f93010f8..a0bb5686 100644
--- a/src/projections/nsper.cpp
+++ b/src/projections/nsper.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
namespace { // anonymous namespace
@@ -38,8 +38,8 @@ PROJ_HEAD(tpers, "Tilted perspective") "\n\tAzi, Sph\n\ttilt= azi= h=";
# define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -93,8 +93,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosz, sinz;
diff --git a/src/projections/nzmg.cpp b/src/projections/nzmg.cpp
index bf0862fb..1c2d9fb7 100644
--- a/src/projections/nzmg.cpp
+++ b/src/projections/nzmg.cpp
@@ -29,7 +29,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(nzmg, "New Zealand Map Grid") "\n\tfixed Earth";
@@ -57,8 +58,8 @@ static const double tpsi[] = { .6399175073, -.1358797613, .063294409, -.02526853
#define Ntphi 8
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
COMPLEX p;
const double *C;
int i;
@@ -76,8 +77,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
int nn, i;
COMPLEX p, f, fp, dp;
double den;
diff --git a/src/projections/ob_tran.cpp b/src/projections/ob_tran.cpp
index d34059a9..1726b622 100644
--- a/src/projections/ob_tran.cpp
+++ b/src/projections/ob_tran.cpp
@@ -5,7 +5,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -24,7 +24,7 @@ PROJ_HEAD(ob_tran, "General Oblique Transformation") "\n\tMisc Sph"
#define TOL 1e-10
-static XY o_forward(LP lp, PJ *P) { /* spheroid */
+static PJ_XY o_forward(PJ_LP lp, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinphi, cosphi;
@@ -39,7 +39,7 @@ static XY o_forward(LP lp, PJ *P) { /* spheroid */
}
-static XY t_forward(LP lp, PJ *P) { /* spheroid */
+static PJ_XY t_forward(PJ_LP lp, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, coslam;
@@ -52,12 +52,12 @@ static XY t_forward(LP lp, PJ *P) { /* spheroid */
}
-static LP o_inverse(XY xy, PJ *P) { /* spheroid */
+static PJ_LP o_inverse(PJ_XY xy, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinphi, cosphi;
- LP lp = Q->link->inv(xy, Q->link);
+ PJ_LP lp = Q->link->inv(xy, Q->link);
if (lp.lam != HUGE_VAL) {
coslam = cos(lp.lam -= Q->lamp);
sinphi = sin(lp.phi);
@@ -70,12 +70,12 @@ static LP o_inverse(XY xy, PJ *P) { /* spheroid */
}
-static LP t_inverse(XY xy, PJ *P) { /* spheroid */
+static PJ_LP t_inverse(PJ_XY xy, PJ *P) { /* spheroid */
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, t;
- LP lp = Q->link->inv(xy, Q->link);
+ PJ_LP lp = Q->link->inv(xy, Q->link);
if (lp.lam != HUGE_VAL) {
cosphi = cos(lp.phi);
t = lp.lam - Q->lamp;
diff --git a/src/projections/ocea.cpp b/src/projections/ocea.cpp
index 0576ace7..75aa6666 100644
--- a/src/projections/ocea.cpp
+++ b/src/projections/ocea.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(ocea, "Oblique Cylindrical Equal Area") "\n\tCyl, Sph"
"lonc= alpha= or\n\tlat_1= lat_2= lon_1= lon_2=";
@@ -20,8 +21,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
xy.y = sin(lp.lam);
@@ -35,8 +36,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, s;
diff --git a/src/projections/oea.cpp b/src/projections/oea.cpp
index 0c401b2f..f2fc1053 100644
--- a/src/projections/oea.cpp
+++ b/src/projections/oea.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(oea, "Oblated Equal Area") "\n\tMisc Sph\n\tn= m= theta=";
@@ -16,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double Az, M, N, cp, sp, cl, shz;
@@ -35,8 +35,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double N, M, xp, yp, z, Az, cz, sz, cAz;
diff --git a/src/projections/omerc.cpp b/src/projections/omerc.cpp
index ead07128..e9b7b4a0 100644
--- a/src/projections/omerc.cpp
+++ b/src/projections/omerc.cpp
@@ -27,7 +27,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(omerc, "Oblique Mercator")
"\n\tCyl, Sph&Ell no_rot\n\t"
@@ -45,8 +45,8 @@ struct pj_opaque {
#define EPS 1.e-10
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double S, T, U, V, W, temp, u, v;
@@ -84,8 +84,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double u, v, Qp, Sp, Tp, Vp, Up;
diff --git a/src/projections/ortho.cpp b/src/projections/ortho.cpp
index 6ea55248..d4300bd5 100644
--- a/src/projections/ortho.cpp
+++ b/src/projections/ortho.cpp
@@ -3,7 +3,7 @@
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(ortho, "Orthographic") "\n\tAzi, Sph";
@@ -26,15 +26,15 @@ struct pj_opaque {
#define EPS10 1.e-10
-static XY forward_error(PJ *P, LP lp, XY xy) {
+static PJ_XY forward_error(PJ *P, PJ_LP lp, PJ_XY xy) {
proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
proj_log_trace(P, "Coordinate (%.3f, %.3f) is on the unprojected hemisphere",
proj_todeg(lp.lam), proj_todeg(lp.phi));
return xy;
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy;
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, cosphi, sinphi;
@@ -67,8 +67,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp;
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rh, cosc, sinc;
diff --git a/src/projections/patterson.cpp b/src/projections/patterson.cpp
index 0d19414e..7f0ea3a9 100644
--- a/src/projections/patterson.cpp
+++ b/src/projections/patterson.cpp
@@ -42,7 +42,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(patterson, "Patterson Cylindrical") "\n\tCyl";
@@ -60,8 +61,8 @@ PROJ_HEAD(patterson, "Patterson Cylindrical") "\n\tCyl";
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double phi2;
(void) P;
@@ -73,8 +74,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double yc, tol, y2, f, fder;
int i;
(void) P;
diff --git a/src/projections/poly.cpp b/src/projections/poly.cpp
index a970fdb1..b4b61b00 100644
--- a/src/projections/poly.cpp
+++ b/src/projections/poly.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(poly, "Polyconic (American)")
"\n\tConic, Sph&Ell";
@@ -23,8 +23,8 @@ struct pj_opaque {
#define ITOL 1.e-12
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double ms, sp, cp;
@@ -42,8 +42,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cot, E;
@@ -60,8 +60,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.y += Q->ml0;
@@ -104,8 +104,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double B, dphi, tp;
int i;
diff --git a/src/projections/putp2.cpp b/src/projections/putp2.cpp
index d7a847c8..d5b3b9f5 100644
--- a/src/projections/putp2.cpp
+++ b/src/projections/putp2.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl, Sph";
@@ -14,8 +15,8 @@ PROJ_HEAD(putp2, "Putnins P2") "\n\tPCyl, Sph";
#define PI_DIV_3 1.0471975511965977
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double p, c, s, V;
int i;
(void) P;
@@ -40,8 +41,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double c;
lp.phi = aasin(P->ctx,xy.y / C_y);
diff --git a/src/projections/putp3.cpp b/src/projections/putp3.cpp
index 98bb2ff0..bc4a02e4 100644
--- a/src/projections/putp3.cpp
+++ b/src/projections/putp3.cpp
@@ -1,6 +1,8 @@
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -15,8 +17,8 @@ PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl, Sph";
#define RPISQ 0.1013211836
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = C * lp.lam * (1. - static_cast<struct pj_opaque*>(P->opaque)->A * lp.phi * lp.phi);
xy.y = C * lp.phi;
@@ -25,8 +27,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / C;
lp.lam = xy.x / (C * (1. - static_cast<struct pj_opaque*>(P->opaque)->A * lp.phi * lp.phi));
diff --git a/src/projections/putp4p.cpp b/src/projections/putp4p.cpp
index 608fc76e..462dae81 100644
--- a/src/projections/putp4p.cpp
+++ b/src/projections/putp4p.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -15,8 +16,8 @@ PROJ_HEAD(putp4p, "Putnins P4'") "\n\tPCyl, Sph";
PROJ_HEAD(weren, "Werenskiold I") "\n\tPCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx,0.883883476 * sin(lp.phi));
@@ -28,8 +29,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = aasin(P->ctx,xy.y / Q->C_y);
diff --git a/src/projections/putp5.cpp b/src/projections/putp5.cpp
index 79e2ad15..62cb2ea9 100644
--- a/src/projections/putp5.cpp
+++ b/src/projections/putp5.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -18,8 +19,8 @@ PROJ_HEAD(putp5p, "Putnins P5'") "\n\tPCyl, Sph";
#define D 1.2158542
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
xy.x = C * lp.lam * (Q->A - Q->B * sqrt(1. + D * lp.phi * lp.phi));
@@ -29,8 +30,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
lp.phi = xy.y / C;
diff --git a/src/projections/putp6.cpp b/src/projections/putp6.cpp
index 1186b18b..4bae7ae6 100644
--- a/src/projections/putp6.cpp
+++ b/src/projections/putp6.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -19,8 +20,8 @@ PROJ_HEAD(putp6p, "Putnins P6'") "\n\tPCyl, Sph";
#define CON_POLE 1.732050807568877
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double p, r, V;
int i;
@@ -43,8 +44,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double r;
diff --git a/src/projections/qsc.cpp b/src/projections/qsc.cpp
index b50a7c95..409afb38 100644
--- a/src/projections/qsc.cpp
+++ b/src/projections/qsc.cpp
@@ -43,7 +43,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* The six cube faces. */
namespace { // anonymous namespace
@@ -118,8 +119,8 @@ static double qsc_shift_lon_origin(double lon, double offset) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double lat, lon;
double theta, phi;
@@ -234,8 +235,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double mu, nu, cosmu, tannu;
double tantheta, theta, cosphi, phi;
diff --git a/src/projections/robin.cpp b/src/projections/robin.cpp
index 987977ae..8f142aad 100644
--- a/src/projections/robin.cpp
+++ b/src/projections/robin.cpp
@@ -2,7 +2,7 @@
#include "proj_math.h"
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(robin, "Robinson") "\n\tPCyl, Sph";
@@ -78,8 +78,8 @@ static const struct COEFS Y[] = {
/* Not sure at all of the appropriate number for MAX_ITER... */
#define MAX_ITER 100
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
long i;
double dphi;
(void) P;
@@ -100,8 +100,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
long i;
double t, t1;
struct COEFS T;
diff --git a/src/projections/rouss.cpp b/src/projections/rouss.cpp
index 3b4428bc..f58277b8 100644
--- a/src/projections/rouss.cpp
+++ b/src/projections/rouss.cpp
@@ -29,7 +29,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -44,8 +44,8 @@ struct pj_opaque {
PROJ_HEAD(rouss, "Roussilhe Stereographic") "\n\tAzi, Ell";
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, al, cp, sp, al2, s2;
@@ -65,8 +65,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double s, al, x = xy.x / P->k0, y = xy.y / P->k0, x2, y2;;
diff --git a/src/projections/rpoly.cpp b/src/projections/rpoly.cpp
index a34f6171..6e883ab2 100644
--- a/src/projections/rpoly.cpp
+++ b/src/projections/rpoly.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -19,8 +20,8 @@ PROJ_HEAD(rpoly, "Rectangular Polyconic")
#define EPS 1e-9
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double fa;
diff --git a/src/projections/sch.cpp b/src/projections/sch.cpp
index 5a2f944b..f4c66688 100644
--- a/src/projections/sch.cpp
+++ b/src/projections/sch.cpp
@@ -36,7 +36,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geocent.h"
namespace { // anonymous namespace
@@ -55,8 +55,8 @@ struct pj_opaque {
PROJ_HEAD(sch, "Spherical Cross-track Height") "\n\tMisc\n\tplat_0= plon_0= phdg_0= [h_0=]";
-static LPZ inverse3d(XYZ xyz, PJ *P) {
- LPZ lpz = {0.0, 0.0, 0.0};
+static PJ_LPZ inverse3d(PJ_XYZ xyz, PJ *P) {
+ PJ_LPZ lpz = {0.0, 0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double temp[3];
double pxyz[3];
@@ -93,8 +93,8 @@ static LPZ inverse3d(XYZ xyz, PJ *P) {
return lpz;
}
-static XYZ forward3d(LPZ lpz, PJ *P) {
- XYZ xyz = {0.0, 0.0, 0.0};
+static PJ_XYZ forward3d(PJ_LPZ lpz, PJ *P) {
+ PJ_XYZ xyz = {0.0, 0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double temp[3];
double pxyz[3];
diff --git a/src/projections/sconics.cpp b/src/projections/sconics.cpp
index 1d19a13d..7bdd2603 100644
--- a/src/projections/sconics.cpp
+++ b/src/projections/sconics.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -62,8 +62,8 @@ static int phi12(PJ *P, double *del) {
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
@@ -85,8 +85,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, (and ellipsoidal?) inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, (and ellipsoidal?) inverse */
+ PJ_LP lp = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho;
diff --git a/src/projections/somerc.cpp b/src/projections/somerc.cpp
index 15d2e765..ead9090f 100644
--- a/src/projections/somerc.cpp
+++ b/src/projections/somerc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(somerc, "Swiss. Obl. Mercator") "\n\tCyl, Ell\n\tFor CH1903";
@@ -18,8 +18,8 @@ struct pj_opaque {
#define NITER 6
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double phip, lamp, phipp, lampp, sp, cp;
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
@@ -37,8 +37,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double phip, lamp, phipp, lampp, cp, esp, con, delp;
int i;
diff --git a/src/projections/stere.cpp b/src/projections/stere.cpp
index 1502b2a6..9b24a596 100644
--- a/src/projections/stere.cpp
+++ b/src/projections/stere.cpp
@@ -1,7 +1,7 @@
#define PJ_LIB__
#include <errno.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "proj_math.h"
PROJ_HEAD(stere, "Stereographic") "\n\tAzi, Sph&Ell\n\tlat_ts=";
@@ -41,8 +41,8 @@ static double ssfn_ (double phit, double sinphi, double eccen) {
}
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double coslam, sinlam, sinX = 0.0, cosX = 0.0, X, A = 0.0, sinphi;
@@ -89,8 +89,8 @@ xmul:
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double sinphi, cosphi, coslam, sinlam;
@@ -131,8 +131,8 @@ oblcon:
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosphi, sinphi, tp=0.0, phi_l=0.0, rho, halfe=0.0, halfpi=0.0;
int i;
@@ -181,8 +181,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c, rh, sinc, cosc;
diff --git a/src/projections/sterea.cpp b/src/projections/sterea.cpp
index bb498068..b6ebc7b4 100644
--- a/src/projections/sterea.cpp
+++ b/src/projections/sterea.cpp
@@ -25,7 +25,8 @@
*/
#define PJ_LIB__
#include <errno.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_math.h"
@@ -43,8 +44,8 @@ PROJ_HEAD(sterea, "Oblique Stereographic Alternative") "\n\tAzimuthal, Sph&Ell";
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cosc, sinc, cosl, k;
@@ -59,8 +60,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double rho, c, sinc, cosc;
diff --git a/src/projections/sts.cpp b/src/projections/sts.cpp
index 9f889611..27dc3eb8 100644
--- a/src/projections/sts.cpp
+++ b/src/projections/sts.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(kav5, "Kavraisky V") "\n\tPCyl, Sph";
PROJ_HEAD(qua_aut, "Quartic Authalic") "\n\tPCyl, Sph";
@@ -19,8 +20,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
@@ -39,8 +40,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double c;
diff --git a/src/projections/tcc.cpp b/src/projections/tcc.cpp
index 64fdc182..cfac9974 100644
--- a/src/projections/tcc.cpp
+++ b/src/projections/tcc.cpp
@@ -3,15 +3,15 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tcc, "Transverse Central Cylindrical") "\n\tCyl, Sph, no inv";
#define EPS10 1.e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double b, bt;
b = cos (lp.phi) * sin (lp.lam);
diff --git a/src/projections/tcea.cpp b/src/projections/tcea.cpp
index d30f3df0..d780718d 100644
--- a/src/projections/tcea.cpp
+++ b/src/projections/tcea.cpp
@@ -2,21 +2,22 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(tcea, "Transverse Cylindrical Equal Area") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = cos (lp.phi) * sin (lp.lam) / P->k0;
xy.y = P->k0 * (atan2 (tan (lp.phi), cos (lp.lam)) - P->phi0);
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double t;
xy.y = xy.y / P->k0 + P->phi0;
diff --git a/src/projections/times.cpp b/src/projections/times.cpp
index e8b4499f..4a0d0f59 100644
--- a/src/projections/times.cpp
+++ b/src/projections/times.cpp
@@ -33,13 +33,14 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(times, "Times") "\n\tCyl, Sph";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
double T, S, S2;
- XY xy = {0.0,0.0};
+ PJ_XY xy = {0.0,0.0};
(void) P;
T = tan(lp.phi/2.0);
@@ -53,9 +54,9 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
double T, S, S2;
- LP lp = {0.0,0.0};
+ PJ_LP lp = {0.0,0.0};
(void) P;
T = xy.y / 1.70711;
diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp
index 5a2dacbd..d1938116 100644
--- a/src/projections/tmerc.cpp
+++ b/src/projections/tmerc.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tmerc, "Transverse Mercator") "\n\tCyl, Sph&Ell";
@@ -28,8 +28,8 @@ struct pj_opaque {
#define FC8 .01785714285714285714
-static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double al, als, n, cosphi, sinphi, t;
@@ -70,8 +70,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double b, cosphi;
/*
@@ -115,8 +115,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double n, con, cosphi, d, ds, sinphi, t;
@@ -149,8 +149,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double h, g;
h = exp(xy.x / static_cast<struct pj_opaque*>(P->opaque)->esp);
diff --git a/src/projections/tobmerc.cpp b/src/projections/tobmerc.cpp
index 9c939f0b..95960097 100644
--- a/src/projections/tobmerc.cpp
+++ b/src/projections/tobmerc.cpp
@@ -6,7 +6,7 @@
#include "proj_internal.h"
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tobmerc, "Tobler-Mercator") "\n\tCyl, Sph";
@@ -19,8 +19,8 @@ static double logtanpfpim1(double x) { /* log(tan(x/2 + M_FORTPI)) */
return log(tan(M_FORTPI + .5 * x));
}
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double cosphi;
if (fabs(fabs(lp.phi) - M_HALFPI) <= EPS10) {
@@ -34,8 +34,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
double cosphi;
lp.phi = atan(sinh(xy.y / P->k0));
diff --git a/src/projections/tpeqd.cpp b/src/projections/tpeqd.cpp
index 2720327a..20921de4 100644
--- a/src/projections/tpeqd.cpp
+++ b/src/projections/tpeqd.cpp
@@ -2,7 +2,7 @@
#include <errno.h>
#include "proj.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(tpeqd, "Two Point Equidistant")
@@ -16,8 +16,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t, z1, z2, dl1, dl2, sp, cp;
@@ -37,8 +37,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double cz1, cz2, s, d, cp, sp;
diff --git a/src/projections/urm5.cpp b/src/projections/urm5.cpp
index 0e3c7e3c..a93293c0 100644
--- a/src/projections/urm5.cpp
+++ b/src/projections/urm5.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl, Sph, no inv\n\tn= q= alpha=";
@@ -15,8 +15,8 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double t;
diff --git a/src/projections/urmfps.cpp b/src/projections/urmfps.cpp
index 7103222a..3a51798b 100644
--- a/src/projections/urmfps.cpp
+++ b/src/projections/urmfps.cpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph\n\tn=";
PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph";
@@ -19,8 +19,8 @@ struct pj_opaque {
#define Cy 1.139753528477
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
lp.phi = aasin (P->ctx,static_cast<struct pj_opaque*>(P->opaque)->n * sin (lp.phi));
xy.x = C_x * lp.lam * cos (lp.phi);
xy.y = static_cast<struct pj_opaque*>(P->opaque)->C_y * lp.phi;
@@ -28,8 +28,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0, 0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0, 0.0};
xy.y /= static_cast<struct pj_opaque*>(P->opaque)->C_y;
lp.phi = aasin(P->ctx, sin (xy.y) / static_cast<struct pj_opaque*>(P->opaque)->n);
lp.lam = xy.x / (C_x * cos (xy.y));
diff --git a/src/projections/vandg.cpp b/src/projections/vandg.cpp
index d148e210..89620356 100644
--- a/src/projections/vandg.cpp
+++ b/src/projections/vandg.cpp
@@ -1,6 +1,6 @@
#define PJ_LIB__
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph";
@@ -13,8 +13,8 @@ PROJ_HEAD(vandg, "van der Grinten (I)") "\n\tMisc Sph";
# define HPISQ 4.93480220054467930934
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double al, al2, g, g2, p2;
p2 = fabs(lp.phi / M_HALFPI);
@@ -58,8 +58,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
double t, c0, c1, c2, c3, al, r2, r, m, d, ay, x2, y2;
x2 = xy.x * xy.x;
diff --git a/src/projections/vandg2.cpp b/src/projections/vandg2.cpp
index 61d50044..de63b085 100644
--- a/src/projections/vandg2.cpp
+++ b/src/projections/vandg2.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
namespace { // anonymous namespace
struct pj_opaque {
@@ -17,8 +18,8 @@ PROJ_HEAD(vandg3, "van der Grinten III") "\n\tMisc Sph, no inv";
#define TOL 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
struct pj_opaque *Q = static_cast<struct pj_opaque*>(P->opaque);
double x1, at, bt, ct;
diff --git a/src/projections/vandg4.cpp b/src/projections/vandg4.cpp
index d9a53c87..8511431d 100644
--- a/src/projections/vandg4.cpp
+++ b/src/projections/vandg4.cpp
@@ -2,15 +2,16 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(vandg4, "van der Grinten IV") "\n\tMisc Sph, no inv";
#define TOL 1e-10
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
double x1, t, bt, ct, ft, bt2, ct2, dt, dt2;
(void) P;
diff --git a/src/projections/wag2.cpp b/src/projections/wag2.cpp
index 1bee737a..e04cc648 100644
--- a/src/projections/wag2.cpp
+++ b/src/projections/wag2.cpp
@@ -2,7 +2,8 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl, Sph";
@@ -12,8 +13,8 @@ PROJ_HEAD(wag2, "Wagner II") "\n\tPCyl, Sph";
#define C_p2 0.88550
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
lp.phi = aasin (P->ctx,C_p1 * sin (C_p2 * lp.phi));
xy.x = C_x * lp.lam * cos (lp.phi);
xy.y = C_y * lp.phi;
@@ -21,8 +22,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y / C_y;
lp.lam = xy.x / (C_x * cos(lp.phi));
lp.phi = aasin (P->ctx,sin(lp.phi) / C_p1) / C_p2;
diff --git a/src/projections/wag3.cpp b/src/projections/wag3.cpp
index bb1b4d49..ed695ffd 100644
--- a/src/projections/wag3.cpp
+++ b/src/projections/wag3.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl, Sph\n\tlat_ts=";
@@ -16,16 +17,16 @@ struct pj_opaque {
} // anonymous namespace
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = static_cast<struct pj_opaque*>(P->opaque)->C_x * lp.lam * cos(TWOTHIRD * lp.phi);
xy.y = lp.phi;
return xy;
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y;
lp.lam = xy.x / (static_cast<struct pj_opaque*>(P->opaque)->C_x * cos(TWOTHIRD * lp.phi));
return lp;
diff --git a/src/projections/wag7.cpp b/src/projections/wag7.cpp
index c8807f12..45b70ee2 100644
--- a/src/projections/wag7.cpp
+++ b/src/projections/wag7.cpp
@@ -2,14 +2,15 @@
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wag7, "Wagner VII") "\n\tMisc Sph, no inv";
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double theta, ct, D;
(void) P; /* Shut up compiler warnnings about unused P */
diff --git a/src/projections/wink1.cpp b/src/projections/wink1.cpp
index de2f55ee..75abbffc 100644
--- a/src/projections/wink1.cpp
+++ b/src/projections/wink1.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wink1, "Winkel I") "\n\tPCyl, Sph\n\tlat_ts=";
@@ -15,16 +16,16 @@ struct pj_opaque {
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0,0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0,0.0};
xy.x = .5 * lp.lam * (static_cast<struct pj_opaque*>(P->opaque)->cosphi1 + cos(lp.phi));
xy.y = lp.phi;
return (xy);
}
-static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
- LP lp = {0.0,0.0};
+static PJ_LP s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, inverse */
+ PJ_LP lp = {0.0,0.0};
lp.phi = xy.y;
lp.lam = 2. * xy.x / (static_cast<struct pj_opaque*>(P->opaque)->cosphi1 + cos(lp.phi));
return (lp);
diff --git a/src/projections/wink2.cpp b/src/projections/wink2.cpp
index 74a47283..6957bde1 100644
--- a/src/projections/wink2.cpp
+++ b/src/projections/wink2.cpp
@@ -3,7 +3,8 @@
#include <errno.h>
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
PROJ_HEAD(wink2, "Winkel II") "\n\tPCyl, Sph, no inv\n\tlat_1=";
@@ -17,8 +18,8 @@ struct pj_opaque {
#define LOOP_TOL 1e-7
-static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
- XY xy = {0.0, 0.0};
+static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
+ PJ_XY xy = {0.0, 0.0};
double k, V;
int i;
diff --git a/src/projects.h b/src/projects.h
deleted file mode 100644
index b76205a5..00000000
--- a/src/projects.h
+++ /dev/null
@@ -1,845 +0,0 @@
-/******************************************************************************
- * Project: PROJ.4
- * Purpose: Primary (private) include file for PROJ.4 library.
- * Author: Gerald Evenden
- *
- ******************************************************************************
- * Copyright (c) 2000, Frank Warmerdam
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-/* General projections header file */
-#ifndef PROJECTS_H
-#define PROJECTS_H
-
-#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
-#endif
-
-#ifdef _MSC_VER
-# ifndef _CRT_SECURE_NO_DEPRECATE
-# define _CRT_SECURE_NO_DEPRECATE
-# endif
-# ifndef _CRT_NONSTDC_NO_DEPRECATE
-# define _CRT_NONSTDC_NO_DEPRECATE
-# endif
-/* enable predefined math constants M_* for MS Visual Studio workaround */
-# ifndef _USE_MATH_DEFINES
-# define _USE_MATH_DEFINES
-# endif
-#endif
-
-#ifdef PROJ_RENAME_SYMBOLS
-#include "proj_symbol_rename.h"
-#endif
-
-/* standard inclusions */
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef PROJ_DLL
-#ifdef PROJ_MSVC_DLL_EXPORT
-#define PROJ_DLL __declspec(dllexport)
-#elif defined(PROJ_MSVC_DLL_IMPORT)
-#define PROJ_DLL __declspec(dllimport)
-#elif defined(__GNUC__)
-#define PROJ_DLL __attribute__ ((visibility("default")))
-#else
-#define PROJ_DLL
-#endif
-#endif
-
-#ifdef __cplusplus
-#define C_NAMESPACE extern "C"
-#define C_NAMESPACE_VAR extern "C"
-extern "C" {
-#else
-#define C_NAMESPACE extern
-#define C_NAMESPACE_VAR
-#endif
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-#ifndef FALSE
-# define FALSE 0
-#endif
-
-#ifndef TRUE
-# define TRUE 1
-#endif
-
-#ifndef MAX
-# define MIN(a,b) ((a<b) ? a : b)
-# define MAX(a,b) ((a>b) ? a : b)
-#endif
-
-#ifndef ABS
-# define ABS(x) ((x<0) ? (-1*(x)) : x)
-#endif
-
-#if INT_MAX == 2147483647
-typedef int pj_int32;
-#elif LONG_MAX == 2147483647
-typedef long pj_int32;
-#else
-#warning It seems no 32-bit integer type is available
-#endif
-
-/* maximum path/filename */
-#ifndef MAX_PATH_FILENAME
-#define MAX_PATH_FILENAME 1024
-#endif
-
-/* If we still haven't got M_PI*, we rely on our own defines.
- * For example, this is necessary when compiling with gcc and
- * the -ansi flag.
- */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#define M_PI_2 1.57079632679489661923
-#define M_PI_4 0.78539816339744830962
-#define M_2_PI 0.63661977236758134308
-#endif
-
-/* M_SQRT2 might be missing */
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
-/* some more useful math constants and aliases */
-#define M_FORTPI M_PI_4 /* pi/4 */
-#define M_HALFPI M_PI_2 /* pi/2 */
-#define M_PI_HALFPI 4.71238898038468985769 /* 1.5*pi */
-#define M_TWOPI 6.28318530717958647693 /* 2*pi */
-#define M_TWO_D_PI M_2_PI /* 2/pi */
-#define M_TWOPI_HALFPI 7.85398163397448309616 /* 2.5*pi */
-
-
-/* maximum tag id length for +init and default files */
-#ifndef ID_TAG_MAX
-#define ID_TAG_MAX 50
-#endif
-
-/* Use WIN32 as a standard windows 32 bit declaration */
-#if defined(_WIN32) && !defined(WIN32)
-# define WIN32
-#endif
-
-#if defined(_WINDOWS) && !defined(WIN32)
-# define WIN32
-#endif
-
-/* directory delimiter for DOS support */
-#ifdef WIN32
-#define DIR_CHAR '\\'
-#else
-#define DIR_CHAR '/'
-#endif
-
-#define USE_PROJUV
-
-typedef struct { double u, v; } projUV;
-typedef struct { double r, i; } COMPLEX;
-typedef struct { double u, v, w; } projUVW;
-
-/* If user explicitly includes proj.h, before projects.h, then avoid implicit type-punning */
-#ifndef PROJ_H
-#ifndef PJ_LIB__
-#define XY projUV
-#define LP projUV
-#define XYZ projUVW
-#define LPZ projUVW
-
-#else
-typedef struct { double x, y; } XY;
-typedef struct { double x, y, z; } XYZ;
-typedef struct { double lam, phi; } LP;
-typedef struct { double lam, phi, z; } LPZ;
-typedef struct { double u, v; } UV;
-typedef struct { double u, v, w; } UVW;
-#endif /* ndef PJ_LIB__ */
-
-#else
-typedef PJ_XY XY;
-typedef PJ_LP LP;
-typedef PJ_UV UV;
-typedef PJ_XYZ XYZ;
-typedef PJ_LPZ LPZ;
-typedef PJ_UVW UVW;
-
-#endif /* ndef PROJ_H */
-
-
-/* Forward declarations and typedefs for stuff needed inside the PJ object */
-struct PJconsts;
-
-union PJ_COORD;
-struct geod_geodesic;
-struct ARG_list;
-struct PJ_REGION_S;
-typedef struct PJ_REGION_S PJ_Region;
-typedef struct ARG_list paralist; /* parameter list */
-#ifndef PROJ_INTERNAL_H
-enum pj_io_units {
- PJ_IO_UNITS_WHATEVER = 0, /* Doesn't matter (or depends on pipeline neighbours) */
- PJ_IO_UNITS_CLASSIC = 1, /* Scaled meters (right), projected system */
- PJ_IO_UNITS_PROJECTED = 2, /* Meters, projected system */
- PJ_IO_UNITS_CARTESIAN = 3, /* Meters, 3D cartesian system */
- PJ_IO_UNITS_ANGULAR = 4 /* Radians */
-};
-#endif
-#ifndef PROJ_H
-typedef struct PJconsts PJ; /* the PJ object herself */
-typedef union PJ_COORD PJ_COORD;
-#endif
-
-struct PJ_REGION_S {
- double ll_long; /* lower left corner coordinates (radians) */
- double ll_lat;
- double ur_long; /* upper right corner coordinates (radians) */
- double ur_lat;
-};
-
-struct PJ_AREA {
- int bbox_set;
- double west_lon_degree;
- double south_lat_degree;
- double east_lon_degree;
- double north_lat_degree;
-};
-
-struct projCtx_t;
-typedef struct projCtx_t projCtx_t;
-
-/*****************************************************************************
-
- Some function types that are especially useful when working with PJs
-
-******************************************************************************
-
-PJ_CONSTRUCTOR:
-
- A function taking a pointer-to-PJ as arg, and returning a pointer-to-PJ.
- Historically called twice: First with a 0 argument, to allocate memory,
- second with the first return value as argument, for actual setup.
-
-PJ_DESTRUCTOR:
-
- A function taking a pointer-to-PJ and an integer as args, then first
- handling the deallocation of the PJ, afterwards handing the integer over
- to the error reporting subsystem, and finally returning a null pointer in
- support of the "return free (P)" (aka "get the hell out of here") idiom.
-
-PJ_OPERATOR:
-
- A function taking a PJ_COORD and a pointer-to-PJ as args, applying the
- PJ to the PJ_COORD, and returning the resulting PJ_COORD.
-
-*****************************************************************************/
-typedef PJ *(* PJ_CONSTRUCTOR) (PJ *);
-typedef PJ *(* PJ_DESTRUCTOR) (PJ *, int);
-typedef PJ_COORD (* PJ_OPERATOR) (PJ_COORD, PJ *);
-/****************************************************************************/
-
-
-
-/* base projection data structure */
-struct PJconsts {
-
- /*************************************************************************************
-
- G E N E R A L P A R A M E T E R S T R U C T
-
- **************************************************************************************
-
- TODO: Need some description here - especially about the thread context...
- This is the struct behind the PJ typedef
-
- **************************************************************************************/
-
- projCtx_t *ctx;
- const char *descr; /* From pj_list.h or individual PJ_*.c file */
- paralist *params; /* Parameter list */
- char *def_full; /* Full textual definition (usually 0 - set by proj_pj_info) */
- char *def_size; /* Shape and size parameters extracted from params */
- char *def_shape;
- char *def_spherification;
- char *def_ellps;
-
- struct geod_geodesic *geod; /* For geodesic computations */
- void *opaque; /* Projection specific parameters, Defined in PJ_*.c */
- int inverted; /* Tell high level API functions to swap inv/fwd */
-
-
- /*************************************************************************************
-
- F U N C T I O N P O I N T E R S
-
- **************************************************************************************
-
- For projection xxx, these are pointers to functions in the corresponding
- PJ_xxx.c file.
-
- pj_init() delegates the setup of these to pj_projection_specific_setup_xxx(),
- a name which is currently hidden behind the magic curtain of the PROJECTION
- macro.
-
- **************************************************************************************/
-
-
- XY (*fwd)(LP, PJ *);
- LP (*inv)(XY, PJ *);
- XYZ (*fwd3d)(LPZ, PJ *);
- LPZ (*inv3d)(XYZ, PJ *);
- PJ_OPERATOR fwd4d;
- PJ_OPERATOR inv4d;
-
- PJ_DESTRUCTOR destructor;
-
-
- /*************************************************************************************
-
- E L L I P S O I D P A R A M E T E R S
-
- **************************************************************************************
-
- Despite YAGNI, we add a large number of ellipsoidal shape parameters, which
- are not yet set up in pj_init. They are, however, inexpensive to compute,
- compared to the overall time taken for setting up the complex PJ object
- (cf. e.g. https://en.wikipedia.org/wiki/Angular_eccentricity).
-
- But during single point projections it will often be a useful thing to have
- these readily available without having to recompute at every pj_fwd / pj_inv
- call.
-
- With this wide selection, we should be ready for quite a number of geodetic
- algorithms, without having to incur further ABI breakage.
-
- **************************************************************************************/
-
- /* The linear parameters */
-
- double a; /* semimajor axis (radius if eccentricity==0) */
- double b; /* semiminor axis */
- double ra; /* 1/a */
- double rb; /* 1/b */
-
- /* The eccentricities */
-
- double alpha; /* angular eccentricity */
- double e; /* first eccentricity */
- double es; /* first eccentricity squared */
- double e2; /* second eccentricity */
- double e2s; /* second eccentricity squared */
- double e3; /* third eccentricity */
- double e3s; /* third eccentricity squared */
- double one_es; /* 1 - e^2 */
- double rone_es; /* 1/one_es */
-
-
- /* The flattenings */
- double f; /* first flattening */
- double f2; /* second flattening */
- double n; /* third flattening */
- double rf; /* 1/f */
- double rf2; /* 1/f2 */
- double rn; /* 1/n */
-
- /* This one's for GRS80 */
- double J; /* "Dynamic form factor" */
-
- double es_orig, a_orig; /* es and a before any +proj related adjustment */
-
-
- /*************************************************************************************
-
- C O O R D I N A T E H A N D L I N G
-
- **************************************************************************************/
-
- int over; /* Over-range flag */
- int geoc; /* Geocentric latitude flag */
- int is_latlong; /* proj=latlong ... not really a projection at all */
- int is_geocent; /* proj=geocent ... not really a projection at all */
- int is_pipeline; /* 1 if PJ represents a pipeline */
- int need_ellps; /* 0 for operations that are purely cartesian */
- int skip_fwd_prepare;
- int skip_fwd_finalize;
- int skip_inv_prepare;
- int skip_inv_finalize;
-
- enum pj_io_units left; /* Flags for input/output coordinate types */
- enum pj_io_units right;
-
- /* These PJs are used for implementing cs2cs style coordinate handling in the 4D API */
- PJ *axisswap;
- PJ *cart;
- PJ *cart_wgs84;
- PJ *helmert;
- PJ *hgridshift;
- PJ *vgridshift;
-
-
- /*************************************************************************************
-
- C A R T O G R A P H I C O F F S E T S
-
- **************************************************************************************/
-
- double lam0, phi0; /* central meridian, parallel */
- double x0, y0, z0, t0; /* false easting and northing (and height and time) */
-
-
- /*************************************************************************************
-
- S C A L I N G
-
- **************************************************************************************/
-
- double k0; /* General scaling factor - e.g. the 0.9996 of UTM */
- double to_meter, fr_meter; /* Plane coordinate scaling. Internal unit [m] */
- double vto_meter, vfr_meter; /* Vertical scaling. Internal unit [m] */
-
-
- /*************************************************************************************
-
- D A T U M S A N D H E I G H T S Y S T E M S
-
- **************************************************************************************
-
- It may be possible, and meaningful, to move the list parts of this up to the
- PJ_CONTEXT level.
-
- **************************************************************************************/
-
- int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */
- double datum_params[7]; /* Parameters for 3PARAM and 7PARAM */
- struct _pj_gi **gridlist; /* TODO: Description needed */
- int gridlist_count;
-
- int has_geoid_vgrids; /* TODO: Description needed */
- struct _pj_gi **vgridlist_geoid; /* TODO: Description needed */
- int vgridlist_geoid_count;
-
- double from_greenwich; /* prime meridian offset (in radians) */
- double long_wrap_center; /* 0.0 for -180 to 180, actually in radians*/
- int is_long_wrap_set;
- char axis[4]; /* Axis order, pj_transform/pj_adjust_axis */
-
- /* New Datum Shift Grid Catalogs */
- char *catalog_name;
- struct _PJ_GridCatalog *catalog;
-
- double datum_date; /* TODO: Description needed */
-
- struct _pj_gi *last_before_grid; /* TODO: Description needed */
- PJ_Region last_before_region; /* TODO: Description needed */
- double last_before_date; /* TODO: Description needed */
-
- struct _pj_gi *last_after_grid; /* TODO: Description needed */
- PJ_Region last_after_region; /* TODO: Description needed */
- double last_after_date; /* TODO: Description needed */
-
-
- /*************************************************************************************
-
- E N D O F G E N E R A L P A R A M E T E R S T R U C T
-
- **************************************************************************************/
-
-};
-
-
-
-
-/* Parameter list (a copy of the +proj=... etc. parameters) */
-struct ARG_list {
- paralist *next;
- char used;
-#if defined(__GNUC__) && __GNUC__ >= 8
- char param[]; /* variable-length member */
- /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */
- /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */
-#else
- char param[1]; /* variable-length member */
-#endif
-};
-
-
-typedef union { double f; int i; char *s; } PROJVALUE;
-
-
-struct PJ_DATUMS {
- const char *id; /* datum keyword */
- const char *defn; /* ie. "to_wgs84=..." */
- const char *ellipse_id; /* ie from ellipse table */
- const char *comments; /* EPSG code, etc */
-};
-
-
-struct DERIVS {
- double x_l, x_p; /* derivatives of x for lambda-phi */
- double y_l, y_p; /* derivatives of y for lambda-phi */
-};
-
-struct FACTORS {
- struct 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; /* always 0 */
-};
-
-/* datum_type values */
-#define PJD_UNKNOWN 0
-#define PJD_3PARAM 1
-#define PJD_7PARAM 2
-#define PJD_GRIDSHIFT 3
-#define PJD_WGS84 4 /* WGS84 (or anything considered equivalent) */
-
-/* library errors */
-#define PJD_ERR_NO_ARGS -1
-#define PJD_ERR_NO_OPTION_IN_INIT_FILE -2
-#define PJD_ERR_NO_COLON_IN_INIT_STRING -3
-#define PJD_ERR_PROJ_NOT_NAMED -4
-#define PJD_ERR_UNKNOWN_PROJECTION_ID -5
-#define PJD_ERR_ECCENTRICITY_IS_ONE -6
-#define PJD_ERR_UNKNOWN_UNIT_ID -7
-#define PJD_ERR_INVALID_BOOLEAN_PARAM -8
-#define PJD_ERR_UNKNOWN_ELLP_PARAM -9
-#define PJD_ERR_REV_FLATTENING_IS_ZERO -10
-#define PJD_ERR_REF_RAD_LARGER_THAN_90 -11
-#define PJD_ERR_ES_LESS_THAN_ZERO -12
-#define PJD_ERR_MAJOR_AXIS_NOT_GIVEN -13
-#define PJD_ERR_LAT_OR_LON_EXCEED_LIMIT -14
-#define PJD_ERR_INVALID_X_OR_Y -15
-#define PJD_ERR_WRONG_FORMAT_DMS_VALUE -16
-#define PJD_ERR_NON_CONV_INV_MERI_DIST -17
-#define PJD_ERR_NON_CON_INV_PHI2 -18
-#define PJD_ERR_ACOS_ASIN_ARG_TOO_LARGE -19
-#define PJD_ERR_TOLERANCE_CONDITION -20
-#define PJD_ERR_CONIC_LAT_EQUAL -21
-#define PJD_ERR_LAT_LARGER_THAN_90 -22
-#define PJD_ERR_LAT1_IS_ZERO -23
-#define PJD_ERR_LAT_TS_LARGER_THAN_90 -24
-#define PJD_ERR_CONTROL_POINT_NO_DIST -25
-#define PJD_ERR_NO_ROTATION_PROJ -26
-#define PJD_ERR_W_OR_M_ZERO_OR_LESS -27
-#define PJD_ERR_LSAT_NOT_IN_RANGE -28
-#define PJD_ERR_PATH_NOT_IN_RANGE -29
-#define PJD_ERR_H_LESS_THAN_ZERO -30
-#define PJD_ERR_K_LESS_THAN_ZERO -31
-#define PJD_ERR_LAT_1_OR_2_ZERO_OR_90 -32
-#define PJD_ERR_LAT_0_OR_ALPHA_EQ_90 -33
-#define PJD_ERR_ELLIPSOID_USE_REQUIRED -34
-#define PJD_ERR_INVALID_UTM_ZONE -35
-#define PJD_ERR_TCHEBY_VAL_OUT_OF_RANGE -36
-#define PJD_ERR_FAILED_TO_FIND_PROJ -37
-#define PJD_ERR_FAILED_TO_LOAD_GRID -38
-#define PJD_ERR_INVALID_M_OR_N -39
-#define PJD_ERR_N_OUT_OF_RANGE -40
-#define PJD_ERR_LAT_1_2_UNSPECIFIED -41
-#define PJD_ERR_ABS_LAT1_EQ_ABS_LAT2 -42
-#define PJD_ERR_LAT_0_HALF_PI_FROM_MEAN -43
-#define PJD_ERR_UNPARSEABLE_CS_DEF -44
-#define PJD_ERR_GEOCENTRIC -45
-#define PJD_ERR_UNKNOWN_PRIME_MERIDIAN -46
-#define PJD_ERR_AXIS -47
-#define PJD_ERR_GRID_AREA -48
-#define PJD_ERR_INVALID_SWEEP_AXIS -49
-#define PJD_ERR_MALFORMED_PIPELINE -50
-#define PJD_ERR_UNIT_FACTOR_LESS_THAN_0 -51
-#define PJD_ERR_INVALID_SCALE -52
-#define PJD_ERR_NON_CONVERGENT -53
-#define PJD_ERR_MISSING_ARGS -54
-#define PJD_ERR_LAT_0_IS_ZERO -55
-#define PJD_ERR_ELLIPSOIDAL_UNSUPPORTED -56
-#define PJD_ERR_TOO_MANY_INITS -57
-#define PJD_ERR_INVALID_ARG -58
-#define PJD_ERR_INCONSISTENT_UNIT -59
-/* NOTE: Remember to update pj_strerrno.c and transient_error in */
-/* pj_transform.c when adding new value */
-
-struct projFileAPI_t;
-
-struct projCppContext;
-
-/* proj thread context */
-struct projCtx_t {
- int last_errno;
- int debug_level;
- void (*logger)(void *, int, const char *);
- void *app_data;
- struct projFileAPI_t *fileapi;
- struct projCppContext* cpp_context; /* internal context for C++ code */
- int use_proj4_init_rules; /* -1 = unknown, 0 = no, 1 = yes */
- int epsg_file_exists; /* -1 = unknown, 0 = no, 1 = yes */
-};
-
-/* classic public API */
-#include "proj_api.h"
-
-
-/* Generate pj_list external or make list from include file */
-#ifndef PJ_DATUMS__
-extern struct PJ_DATUMS pj_datums[];
-#endif
-
-
-
-
-
-#ifdef PJ_LIB__
-#define PROJ_HEAD(name, desc) static const char des_##name [] = desc
-
-#define OPERATION(name, NEED_ELLPS) \
- \
-pj_projection_specific_setup_##name (PJ *P); \
-C_NAMESPACE PJ *pj_##name (PJ *P); \
- \
-C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \
- \
-C_NAMESPACE PJ *pj_##name (PJ *P) { \
- if (P) \
- return pj_projection_specific_setup_##name (P); \
- P = (PJ*) pj_calloc (1, sizeof(PJ)); \
- if (nullptr==P) \
- return nullptr; \
- P->destructor = pj_default_destructor; \
- P->descr = des_##name; \
- P->need_ellps = NEED_ELLPS; \
- P->left = PJ_IO_UNITS_ANGULAR; \
- P->right = PJ_IO_UNITS_CLASSIC; \
- return P; \
-} \
- \
-PJ *pj_projection_specific_setup_##name (PJ *P)
-
-/* In ISO19000 lingo, an operation is either a conversion or a transformation */
-#define CONVERSION(name, need_ellps) OPERATION (name, need_ellps)
-#define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps)
-
-/* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */
-#define PROJECTION(name) CONVERSION (name, 1)
-
-#endif /* def PJ_LIB__ */
-
-
-#define MAX_TAB_ID 80
-typedef struct { float lam, phi; } FLP;
-typedef struct { pj_int32 lam, phi; } ILP;
-
-struct CTABLE {
- char id[MAX_TAB_ID]; /* ascii info */
- LP ll; /* lower left corner coordinates */
- LP del; /* size of cells */
- ILP lim; /* limits of conversion matrix */
- FLP *cvs; /* conversion matrix */
-};
-
-typedef struct _pj_gi {
- char *gridname; /* identifying name of grid, eg "conus" or ntv2_0.gsb */
- char *filename; /* full path to filename */
-
- const char *format; /* format of this grid, ie "ctable", "ntv1",
- "ntv2" or "missing". */
-
- long grid_offset; /* offset in file, for delayed loading */
- int must_swap; /* only for NTv2 */
-
- struct CTABLE *ct;
-
- struct _pj_gi *next;
- struct _pj_gi *child;
-} PJ_GRIDINFO;
-
-typedef struct {
- PJ_Region region;
- int priority; /* higher used before lower */
- double date; /* year.fraction */
- char *definition; /* usually the gridname */
-
- PJ_GRIDINFO *gridinfo;
- int available; /* 0=unknown, 1=true, -1=false */
-} PJ_GridCatalogEntry;
-
-typedef struct _PJ_GridCatalog {
- char *catalog_name;
-
- PJ_Region region; /* maximum extent of catalog data */
-
- int entry_count;
- PJ_GridCatalogEntry *entries;
-
- struct _PJ_GridCatalog *next;
-} PJ_GridCatalog;
-
-/* procedure prototypes */
-double PROJ_DLL dmstor(const char *, char **);
-double dmstor_ctx(projCtx ctx, const char *, char **);
-void PROJ_DLL set_rtodms(int, int);
-char PROJ_DLL *rtodms(char *, double, int, int);
-double PROJ_DLL adjlon(double);
-double aacos(projCtx,double), aasin(projCtx,double), asqrt(double), aatan2(double, double);
-
-PROJVALUE PROJ_DLL pj_param(projCtx ctx, paralist *, const char *);
-paralist PROJ_DLL *pj_param_exists (paralist *list, const char *parameter);
-paralist PROJ_DLL *pj_mkparam(const char *);
-paralist *pj_mkparam_ws (const char *str);
-
-
-int PROJ_DLL pj_ell_set(projCtx ctx, paralist *, double *, double *);
-int pj_datum_set(projCtx,paralist *, PJ *);
-int pj_angular_units_set(paralist *, PJ *);
-
-paralist *pj_clone_paralist( const paralist* );
-paralist *pj_search_initcache( const char *filekey );
-void pj_insert_initcache( const char *filekey, const paralist *list);
-paralist *pj_expand_init(projCtx ctx, paralist *init);
-
-void *pj_dealloc_params (projCtx ctx, paralist *start, int errlev);
-
-
-double *pj_enfn(double);
-double pj_mlfn(double, double, double, double *);
-double pj_inv_mlfn(projCtx, double, double, double *);
-double pj_qsfn(double, double, double);
-double pj_tsfn(double, double, double);
-double pj_msfn(double, double, double);
-double PROJ_DLL pj_phi2(projCtx, double, double);
-double pj_qsfn_(double, PJ *);
-double *pj_authset(double);
-double pj_authlat(double, double *);
-
-COMPLEX pj_zpoly1(COMPLEX, const COMPLEX *, int);
-COMPLEX pj_zpolyd1(COMPLEX, const COMPLEX *, int, COMPLEX *);
-
-int pj_deriv(LP, double, const PJ *, struct DERIVS *);
-int pj_factors(LP, const PJ *, double, struct FACTORS *);
-
-struct PW_COEF { /* row coefficient structure */
- int m; /* number of c coefficients (=0 for none) */
- double *c; /* power coefficients */
-};
-
-/* Approximation structures and procedures */
-typedef struct { /* Chebyshev or Power series structure */
- projUV a, b; /* power series range for evaluation */
- /* or Chebyshev argument shift/scaling */
- struct PW_COEF *cu, *cv;
- int mu, mv; /* maximum cu and cv index (+1 for count) */
- int power; /* != 0 if power series, else Chebyshev */
-} Tseries;
-
-Tseries PROJ_DLL *mk_cheby(projUV, projUV, double, projUV *, projUV (*)(projUV), int, int, int);
-projUV bpseval(projUV, Tseries *);
-projUV bcheval(projUV, Tseries *);
-projUV biveval(projUV, Tseries *);
-void *vector1(int, int);
-void **vector2(int, int, int);
-void freev2(void **v, int nrows);
-int bchgen(projUV, projUV, int, int, projUV **, projUV(*)(projUV));
-int bch2bps(projUV, projUV, projUV **, int, int);
-
-/* nadcon related protos */
-LP nad_intr(LP, struct CTABLE *);
-LP nad_cvt(LP, int, struct CTABLE *);
-struct CTABLE *nad_init(projCtx ctx, char *);
-struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid );
-int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid );
-struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid );
-int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid );
-void nad_free(struct CTABLE *);
-
-/* higher level handling of datum grid shift files */
-
-int pj_apply_vgridshift( PJ *defn, const char *listname,
- PJ_GRIDINFO ***gridlist_p,
- int *gridlist_count_p,
- int inverse,
- long point_count, int point_offset,
- double *x, double *y, double *z );
-int pj_apply_gridshift_2( PJ *defn, int inverse,
- long point_count, int point_offset,
- double *x, double *y, double *z );
-int pj_apply_gridshift_3( projCtx ctx,
- PJ_GRIDINFO **gridlist, int gridlist_count,
- int inverse, long point_count, int point_offset,
- double *x, double *y, double *z );
-
-PJ_GRIDINFO **pj_gridlist_from_nadgrids( projCtx, const char *, int * );
-void PROJ_DLL pj_deallocate_grids();
-
-PJ_GRIDINFO *pj_gridinfo_init( projCtx, const char * );
-int pj_gridinfo_load( projCtx, PJ_GRIDINFO * );
-void pj_gridinfo_free( projCtx, PJ_GRIDINFO * );
-
-PJ_GridCatalog *pj_gc_findcatalog( projCtx, const char * );
-PJ_GridCatalog *pj_gc_readcatalog( projCtx, const char * );
-void pj_gc_unloadall( projCtx );
-int pj_gc_apply_gridshift( PJ *defn, int inverse,
- long point_count, int point_offset,
- double *x, double *y, double *z );
-int pj_gc_apply_gridshift( PJ *defn, int inverse,
- long point_count, int point_offset,
- double *x, double *y, double *z );
-
-PJ_GRIDINFO *pj_gc_findgrid( projCtx ctx,
- PJ_GridCatalog *catalog, int after,
- LP location, double date,
- PJ_Region *optional_region,
- double *grid_date );
-
-double pj_gc_parsedate( projCtx, const char * );
-
-void *proj_mdist_ini(double);
-double proj_mdist(double, double, double, const void *);
-double proj_inv_mdist(projCtx ctx, double, const void *);
-void *pj_gauss_ini(double, double, double *,double *);
-LP pj_gauss(projCtx, LP, const void *);
-LP pj_inv_gauss(projCtx, LP, const void *);
-
-extern char const PROJ_DLL pj_release[];
-
-struct PJ_DATUMS PROJ_DLL *pj_get_datums_ref( void );
-
-PJ *pj_default_destructor (PJ *P, int errlev);
-
-double PROJ_DLL pj_atof( const char* nptr );
-double pj_strtod( const char *nptr, char **endptr );
-void pj_freeup_plain (PJ *P);
-
-projPJ pj_init_ctx_with_allow_init_epsg( projCtx ctx, int argc, char **argv, int allow_init_epsg );
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifndef PROJECTS_H_ATEND
-#define PROJECTS_H_ATEND
-#endif
-#endif /* end of basic projections header */
diff --git a/src/qsfn.cpp b/src/qsfn.cpp
index c18a7b95..35ba3b93 100644
--- a/src/qsfn.cpp
+++ b/src/qsfn.cpp
@@ -1,6 +1,7 @@
/* determine small q */
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
# define EPSILON 1.0e-7
diff --git a/src/release.cpp b/src/release.cpp
index 9beb45ef..ddc768c6 100644
--- a/src/release.cpp
+++ b/src/release.cpp
@@ -1,7 +1,7 @@
/* <<< Release Notice for library >>> */
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
diff --git a/src/rtodms.cpp b/src/rtodms.cpp
index 674cebdf..9b3b7cb9 100644
--- a/src/rtodms.cpp
+++ b/src/rtodms.cpp
@@ -5,7 +5,8 @@
#include <stdio.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/*
** RES is fractional second figures
diff --git a/src/strerrno.cpp b/src/strerrno.cpp
index 18ed0d33..9f690041 100644
--- a/src/strerrno.cpp
+++ b/src/strerrno.cpp
@@ -5,7 +5,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
static const char * const
pj_err_list[] = {
diff --git a/src/strtod.cpp b/src/strtod.cpp
index 5a360c2e..7ab271c5 100644
--- a/src/strtod.cpp
+++ b/src/strtod.cpp
@@ -32,7 +32,8 @@
#include <stdlib.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* Windows nmake build doesn't have a proj_config.h, but HAVE_LOCALECONV */
/* is defined in the compilation line */
diff --git a/src/transform.cpp b/src/transform.cpp
index 433fc017..486178d0 100644
--- a/src/transform.cpp
+++ b/src/transform.cpp
@@ -32,7 +32,7 @@
#include <string.h>
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geocent.h"
static int adjust_axis( projCtx ctx, const char *axis, int denormalize_flag,
@@ -193,8 +193,8 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
for( i = 0; i < n; i++ )
{
- XYZ projected_loc;
- LPZ geodetic_loc;
+ PJ_XYZ projected_loc;
+ PJ_LPZ geodetic_loc;
geodetic_loc.lam = x[dist*i];
geodetic_loc.phi = y[dist*i];
@@ -232,8 +232,8 @@ static int geographic_to_projected (PJ *P, long n, int dist, double *x, double *
for( i = 0; i <n; i++ )
{
- XY projected_loc;
- LP geodetic_loc;
+ PJ_XY projected_loc;
+ PJ_LP geodetic_loc;
geodetic_loc.lam = x[dist*i];
geodetic_loc.phi = y[dist*i];
@@ -303,8 +303,8 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
for (i=0; i < n; i++)
{
- XYZ projected_loc;
- LPZ geodetic_loc;
+ PJ_XYZ projected_loc;
+ PJ_LPZ geodetic_loc;
projected_loc.x = x[dist*i];
projected_loc.y = y[dist*i];
@@ -343,8 +343,8 @@ static int projected_to_geographic (PJ *P, long n, int dist, double *x, double *
/* Fallback to the original PROJ.4 API 2d inversion - inv */
for( i = 0; i < n; i++ ) {
- XY projected_loc;
- LP geodetic_loc;
+ PJ_XY projected_loc;
+ PJ_LP geodetic_loc;
projected_loc.x = x[dist*i];
projected_loc.y = y[dist*i];
diff --git a/src/transformations/affine.cpp b/src/transformations/affine.cpp
index e2b668d3..21529a20 100644
--- a/src/transformations/affine.cpp
+++ b/src/transformations/affine.cpp
@@ -27,7 +27,7 @@
#include "proj_internal.h"
#include "proj.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(affine, "Affine transformation");
PROJ_HEAD(geogoffset, "Geographic Offset");
@@ -70,14 +70,14 @@ static PJ_COORD forward_4d(PJ_COORD obs, PJ *P) {
return newObs;
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
return forward_4d(point, P).xyz;
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lp = lp;
return forward_4d(point, P).xy;
@@ -98,13 +98,13 @@ static PJ_COORD reverse_4d(PJ_COORD obs, PJ *P) {
return newObs;
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
return reverse_4d(point, P).lpz;
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xy = xy;
return reverse_4d(point, P).lp;
diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp
index 0197cf5c..9221d39e 100644
--- a/src/transformations/deformation.cpp
+++ b/src/transformations/deformation.cpp
@@ -19,7 +19,7 @@ returns cartesian coordinates as well.
Corrections in the gridded model are in east, north, up (ENU) space.
Hence the input coordinates needs to be converted to ENU-space when
searching for corrections in the grid. The corrections are then converted
-to cartesian XYZ-space and applied to the input coordinates (also in
+to cartesian PJ_XYZ-space and applied to the input coordinates (also in
cartesian space).
A full deformation model is described by two grids, one for the horizontal
@@ -56,7 +56,7 @@ grid-values in units of mm/year in ENU-space.
#include "proj.h"
#include "proj_internal.h"
#include "proj_math.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(deformation, "Kinematic grid shift");
@@ -72,12 +72,12 @@ struct pj_opaque {
} // anonymous namespace
/********************************************************************************/
-static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
+static PJ_XYZ get_grid_shift(PJ* P, PJ_XYZ cartesian) {
/********************************************************************************
Read correction values from grid. The cartesian input coordinates are
converted to geodetic coordinates in order look up the correction values
in the grid. Once the grid corrections are read we need to convert them
- from ENU-space to cartesian XYZ-space. ENU -> XYZ formula described in:
+ from ENU-space to cartesian PJ_XYZ-space. ENU -> PJ_XYZ formula described in:
Nørbech, T., et al, 2003(?), "Transformation from a Common Nordic Reference
Frame to ETRS89 in Denmark, Finland, Norway, and Sweden – status report"
@@ -109,7 +109,7 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
sl = sin(geodetic.lp.lam);
cl = cos(geodetic.lp.lam);
- /* ENU -> XYZ */
+ /* ENU -> PJ_XYZ */
temp.xyz.x = -sp*cl*shift.enu.n - sl*shift.enu.e + cp*cl*shift.enu.u;
temp.xyz.y = -sp*sl*shift.enu.n + cl*shift.enu.e + cp*sl*shift.enu.u;
temp.xyz.z = cp*shift.enu.n + sp*shift.enu.u;
@@ -122,11 +122,11 @@ static XYZ get_grid_shift(PJ* P, XYZ cartesian) {
}
/********************************************************************************/
-static XYZ reverse_shift(PJ *P, XYZ input, double dt) {
+static PJ_XYZ reverse_shift(PJ *P, PJ_XYZ input, double dt) {
/********************************************************************************
Iteratively determine the reverse grid shift correction values.
*********************************************************************************/
- XYZ out, delta, dif;
+ PJ_XYZ out, delta, dif;
double z0;
int i = MAX_ITERATIONS;
@@ -163,10 +163,10 @@ static XYZ reverse_shift(PJ *P, XYZ input, double dt) {
return out;
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
PJ_COORD out, in;
- XYZ shift;
+ PJ_XYZ shift;
double dt = 0.0;
in.lpz = lpz;
out = in;
@@ -192,7 +192,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
static PJ_COORD forward_4d(PJ_COORD in, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
double dt;
- XYZ shift;
+ PJ_XYZ shift;
PJ_COORD out = in;
if (Q->t_obs != HUGE_VAL) {
@@ -212,7 +212,7 @@ static PJ_COORD forward_4d(PJ_COORD in, PJ *P) {
}
-static LPZ reverse_3d(XYZ in, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ in, PJ *P) {
struct pj_opaque *Q = (struct pj_opaque *) P->opaque;
PJ_COORD out;
double dt = 0.0;
diff --git a/src/transformations/helmert.cpp b/src/transformations/helmert.cpp
index 4a3abf4e..085bbbf9 100644
--- a/src/transformations/helmert.cpp
+++ b/src/transformations/helmert.cpp
@@ -53,14 +53,14 @@ Last update: 2018-10-26
#include <math.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
#include "geocent.h"
PROJ_HEAD(helmert, "3(6)-, 4(8)- and 7(14)-parameter Helmert shift");
PROJ_HEAD(molobadekas, "Molodensky-Badekas transformation");
-static XYZ helmert_forward_3d (LPZ lpz, PJ *P);
-static LPZ helmert_reverse_3d (XYZ xyz, PJ *P);
+static PJ_XYZ helmert_forward_3d (PJ_LPZ lpz, PJ *P);
+static PJ_LPZ helmert_reverse_3d (PJ_XYZ xyz, PJ *P);
@@ -70,10 +70,10 @@ struct pj_opaque_helmert {
/************************************************************************
Projection specific elements for the "helmert" PJ object
************************************************************************/
- XYZ xyz;
- XYZ xyz_0;
- XYZ dxyz;
- XYZ refp;
+ PJ_XYZ xyz;
+ PJ_XYZ xyz_0;
+ PJ_XYZ dxyz;
+ PJ_XYZ refp;
PJ_OPK opk;
PJ_OPK opk_0;
PJ_OPK dopk;
@@ -322,7 +322,7 @@ static void build_rot_matrix(PJ *P) {
/***********************************************************************/
-static XY helmert_forward (LP lp, PJ *P) {
+static PJ_XY helmert_forward (PJ_LP lp, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -342,7 +342,7 @@ static XY helmert_forward (LP lp, PJ *P) {
/***********************************************************************/
-static LP helmert_reverse (XY xy, PJ *P) {
+static PJ_LP helmert_reverse (PJ_XY xy, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -362,7 +362,7 @@ static LP helmert_reverse (XY xy, PJ *P) {
/***********************************************************************/
-static XYZ helmert_forward_3d (LPZ lpz, PJ *P) {
+static PJ_XYZ helmert_forward_3d (PJ_LPZ lpz, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -402,7 +402,7 @@ static XYZ helmert_forward_3d (LPZ lpz, PJ *P) {
/***********************************************************************/
-static LPZ helmert_reverse_3d (XYZ xyz, PJ *P) {
+static PJ_LPZ helmert_reverse_3d (PJ_XYZ xyz, PJ *P) {
/***********************************************************************/
struct pj_opaque_helmert *Q = (struct pj_opaque_helmert *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
diff --git a/src/transformations/hgridshift.cpp b/src/transformations/hgridshift.cpp
index f0e57251..788c2ebb 100644
--- a/src/transformations/hgridshift.cpp
+++ b/src/transformations/hgridshift.cpp
@@ -6,7 +6,7 @@
#include <time.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(hgridshift, "Horizontal grid shift");
@@ -17,7 +17,7 @@ struct pj_opaque_hgridshift {
};
} // anonymous namespace
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
@@ -31,7 +31,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
diff --git a/src/transformations/horner.cpp b/src/transformations/horner.cpp
index 73977de6..f5d749c4 100644
--- a/src/transformations/horner.cpp
+++ b/src/transformations/horner.cpp
@@ -83,8 +83,9 @@
#include <stdio.h>
#include <string.h>
+#include "proj.h"
+#include "proj_internal.h"
#include "proj_internal.h"
-#include "projects.h"
PROJ_HEAD(horner, "Horner polynomial evaluation");
@@ -109,13 +110,13 @@ struct horner {
double *fwd_c; /* coefficients for the complex forward transformations */
double *inv_c; /* coefficients for the complex inverse transformations */
- UV *fwd_origin; /* False longitude/latitude */
- UV *inv_origin; /* False easting/northing */
+ PJ_UV *fwd_origin; /* False longitude/latitude */
+ PJ_UV *inv_origin; /* False easting/northing */
};
} // anonymous namespace
typedef struct horner HORNER;
-static UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, UV position);
+static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position);
static HORNER *horner_alloc (size_t order, int complex_polynomia);
static void horner_free (HORNER *h);
@@ -166,8 +167,8 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) {
polynomia_ok = 1;
}
- h->fwd_origin = static_cast<UV*>(horner_calloc (1, sizeof(UV)));
- h->inv_origin = static_cast<UV*>(horner_calloc (1, sizeof(UV)));
+ h->fwd_origin = static_cast<PJ_UV*>(horner_calloc (1, sizeof(PJ_UV)));
+ h->inv_origin = static_cast<PJ_UV*>(horner_calloc (1, sizeof(PJ_UV)));
if (polynomia_ok && h->fwd_origin && h->inv_origin)
return h;
@@ -181,7 +182,7 @@ static HORNER *horner_alloc (size_t order, int complex_polynomia) {
/**********************************************************************/
-static UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
+static PJ_UV horner_func (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) {
/***********************************************************************
A reimplementation of the classic Engsager/Poder 2D Horner polynomial
@@ -223,7 +224,7 @@ summing the tiny high order elements first.
double *tcx, *tcy; /* Coefficient pointers */
double range; /* Equivalent to the gen_pol's FLOATLIMIT constant */
double n, e;
- UV uv_error;
+ PJ_UV uv_error;
uv_error.u = uv_error.v = HUGE_VAL;
if (nullptr==transformation)
@@ -310,7 +311,7 @@ static PJ_COORD horner_reverse_4d (PJ_COORD point, PJ *P) {
/**********************************************************************/
-static UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, UV position) {
+static PJ_UV complex_horner (const HORNER *transformation, PJ_DIRECTION direction, PJ_UV position) {
/***********************************************************************
A reimplementation of a classic Engsager/Poder Horner complex
@@ -323,7 +324,7 @@ polynomial evaluation engine.
double *c, *cb; /* Coefficient pointers */
double range; /* Equivalent to the gen_pol's FLOATLIMIT constant */
double n, e, w, N, E;
- UV uv_error;
+ PJ_UV uv_error;
uv_error.u = uv_error.v = HUGE_VAL;
if (nullptr==transformation)
diff --git a/src/transformations/molodensky.cpp b/src/transformations/molodensky.cpp
index 91743fda..002c5286 100644
--- a/src/transformations/molodensky.cpp
+++ b/src/transformations/molodensky.cpp
@@ -49,12 +49,12 @@
#include "proj.h"
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(molodensky, "Molodensky transform");
-static XYZ forward_3d(LPZ lpz, PJ *P);
-static LPZ reverse_3d(XYZ xyz, PJ *P);
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P);
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P);
namespace { // anonymous namespace
struct pj_opaque_molodensky {
@@ -123,7 +123,7 @@ static double RM (double a, double es, double phi) {
}
-static LPZ calc_standard_params(LPZ lpz, PJ *P) {
+static PJ_LPZ calc_standard_params(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
double dphi, dlam, dh;
@@ -162,7 +162,7 @@ static LPZ calc_standard_params(LPZ lpz, PJ *P) {
}
-static LPZ calc_abridged_params(LPZ lpz, PJ *P) {
+static PJ_LPZ calc_abridged_params(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
double dphi, dlam, dh;
@@ -197,7 +197,7 @@ static LPZ calc_abridged_params(LPZ lpz, PJ *P) {
}
-static XY forward_2d(LP lp, PJ *P) {
+static PJ_XY forward_2d(PJ_LP lp, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.lp = lp;
@@ -207,7 +207,7 @@ static XY forward_2d(LP lp, PJ *P) {
}
-static LP reverse_2d(XY xy, PJ *P) {
+static PJ_LP reverse_2d(PJ_XY xy, PJ *P) {
PJ_COORD point = {{0,0,0,0}};
point.xy = xy;
@@ -218,7 +218,7 @@ static LP reverse_2d(XY xy, PJ *P) {
}
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
@@ -246,10 +246,10 @@ static PJ_COORD forward_4d(PJ_COORD obs, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque_molodensky *Q = (struct pj_opaque_molodensky *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
- LPZ lpz;
+ PJ_LPZ lpz;
/* calculate parameters depending on the mode we are in */
point.xyz = xyz;
diff --git a/src/transformations/vgridshift.cpp b/src/transformations/vgridshift.cpp
index b3da906d..95537cda 100644
--- a/src/transformations/vgridshift.cpp
+++ b/src/transformations/vgridshift.cpp
@@ -6,7 +6,7 @@
#include <time.h>
#include "proj_internal.h"
-#include "projects.h"
+#include "proj_internal.h"
PROJ_HEAD(vgridshift, "Vertical grid shift");
@@ -18,7 +18,7 @@ struct pj_opaque_vgridshift {
};
} // anonymous namespace
-static XYZ forward_3d(LPZ lpz, PJ *P) {
+static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
struct pj_opaque_vgridshift *Q = (struct pj_opaque_vgridshift *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
point.lpz = lpz;
@@ -33,7 +33,7 @@ static XYZ forward_3d(LPZ lpz, PJ *P) {
}
-static LPZ reverse_3d(XYZ xyz, PJ *P) {
+static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
struct pj_opaque_vgridshift *Q = (struct pj_opaque_vgridshift *) P->opaque;
PJ_COORD point = {{0,0,0,0}};
point.xyz = xyz;
diff --git a/src/tsfn.cpp b/src/tsfn.cpp
index ea3b896d..32da09f2 100644
--- a/src/tsfn.cpp
+++ b/src/tsfn.cpp
@@ -1,6 +1,7 @@
/* determine small t */
#include <math.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
double pj_tsfn(double phi, double sinphi, double e) {
double denominator;
diff --git a/src/units.cpp b/src/units.cpp
index 50f11396..34a71db1 100644
--- a/src/units.cpp
+++ b/src/units.cpp
@@ -5,7 +5,7 @@
#include "proj.h"
#define PJ_UNITS__
-#include "projects.h"
+#include "proj_internal.h"
/* Field 2 that contains the multiplier to convert named units to meters
** may be expressed by either a simple floating point constant or a
diff --git a/src/utils.cpp b/src/utils.cpp
index 8587dc30..9cb13f44 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -31,7 +31,8 @@
#include <stdio.h>
#include <string.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/************************************************************************/
/* pj_is_latlong() */
diff --git a/src/vector1.cpp b/src/vector1.cpp
index 869dd76a..fc69f5c3 100644
--- a/src/vector1.cpp
+++ b/src/vector1.cpp
@@ -1,6 +1,7 @@
/* make storage for one and two dimensional matricies */
#include <stdlib.h>
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
void * /* one dimension array */
vector1(int nvals, int size) { return((void *)pj_malloc(size * nvals)); }
void /* free 2D array */
diff --git a/src/zpoly1.cpp b/src/zpoly1.cpp
index bacb62ce..c7b7a3e3 100644
--- a/src/zpoly1.cpp
+++ b/src/zpoly1.cpp
@@ -1,5 +1,6 @@
/* evaluate complex polynomial */
-#include "projects.h"
+#include "proj.h"
+#include "proj_internal.h"
/* note: coefficients are always from C_1 to C_n
** i.e. C_0 == (0., 0)
** n should always be >= 1 though no checks are made