aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_cart.c
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-07-12 10:15:16 +0200
committerKristian Evers <kristianevers@gmail.com>2017-07-13 12:19:43 +0200
commit608c7c6f568cab02abcebcbc162db47dfdb6da8a (patch)
tree68dbed0d2b25c2cce485118c5e71d7e8f82eaf2e /src/PJ_cart.c
parent36cf55dbaaf26ee9114dc5868993c2f208f5d6fd (diff)
downloadPROJ-608c7c6f568cab02abcebcbc162db47dfdb6da8a.tar.gz
PROJ-608c7c6f568cab02abcebcbc162db47dfdb6da8a.zip
Implemented proj_create_crs_to_crs()
Diffstat (limited to 'src/PJ_cart.c')
-rw-r--r--src/PJ_cart.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/PJ_cart.c b/src/PJ_cart.c
index 26acac2d..9155dd03 100644
--- a/src/PJ_cart.c
+++ b/src/PJ_cart.c
@@ -422,6 +422,29 @@ int pj_cart_selftest (void) {
/* Clean up */
proj_destroy (P);
+
+ /* test proj_create_crs_to_crs() */
+ P = proj_create_crs_to_crs(0, "epsg:25832", "epsg:25833");
+ if (P==0)
+ return 30;
+
+ a.coo.xy.x = 700000.0;
+ a.coo.xy.y = 6000000.0;
+ b.coo.xy.x = 307788.8761171057;
+ b.coo.xy.y = 5999669.3036037628;
+
+ a = proj_trans_obs(P, PJ_FWD, a);
+ if (dist > 1e-7)
+ return 31;
+ proj_destroy(P);
+
+ /* let's make sure that only entries in init-files results in a usable PJ */
+ P = proj_create_crs_to_crs(0, "proj=utm +zone=32 +datum=WGS84", "proj=utm +zone=33 +datum=WGS84");
+ if (P != 0) {
+ proj_destroy(P);
+ return 32;
+ }
+
return 0;
}
#endif