[GRASS-SVN] r74470 - grass/trunk/lib/proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 5 13:27:33 PDT 2019


Author: mmetz
Date: 2019-05-05 13:27:33 -0700 (Sun, 05 May 2019)
New Revision: 74470

Modified:
   grass/trunk/lib/proj/do_proj.c
Log:
libproj: add comments for preparation for PROJ6+

Modified: grass/trunk/lib/proj/do_proj.c
===================================================================
--- grass/trunk/lib/proj/do_proj.c	2019-05-05 20:23:04 UTC (rev 74469)
+++ grass/trunk/lib/proj/do_proj.c	2019-05-05 20:27:33 UTC (rev 74470)
@@ -105,6 +105,10 @@
 		outsrid = G_store_upper(info_out->srid);
 	    else
 		outsrid = G_store(info_out->srid);
+
+	    /* PROJ6+: enforce axis order easting, northing
+	     * +axis=enu (works with proj-4.8+) */
+
 #else
 	    /* PROJ5: EPSG must lowercase epsg */
 	    if (strncmp(info_in->srid, "EPSG", 4) == 0)
@@ -141,7 +145,11 @@
 #endif
 	}
 	if (info_trans->pj == NULL) {
-	    if (info_out->pj != NULL && info_out->def != NULL)
+	    /* PROJ6+: enforce axis order easting, northing
+	     * +axis=enu (works with proj-4.8+) */
+	    /* PROJ6+: what should we do with +towgs ? 
+	     * +towgs works only if WGS84 is used as pivot datum on both sides */
+  	    if (info_out->pj != NULL && info_out->def != NULL)
 		G_asprintf(&(info_trans->def), "+proj=pipeline +step +inv %s +step %s",
 			   info_in->def, info_out->def);
 	    else
@@ -250,7 +258,8 @@
     if (in_is_ll) {
 	/* convert to radians */
 	/* PROJ 6: conversion to radians is not always needed:
-	 * if proj_angular_input(info_trans->pj, dir) == 1 -> convert */
+	 * if proj_angular_input(info_trans->pj, dir) == 1 
+	 * -> convert from degrees to radians */
 	c.lpzt.lam = (*x) / RAD_TO_DEG;
 	c.lpzt.phi = (*y) / RAD_TO_DEG;
 	c.lpzt.z = 0;
@@ -281,7 +290,8 @@
     if (out_is_ll) {
 	/* convert to degrees */
 	/* PROJ 6: conversion to radians is not always needed:
-	 * if proj_angular_output(info_trans->pj, dir) == 1 -> convert */
+	 * if proj_angular_output(info_trans->pj, dir) == 1 
+	 * -> convert from radians to degrees */
 	*x = c.lpzt.lam * RAD_TO_DEG;
 	*y = c.lpzt.phi * RAD_TO_DEG;
 	if (z)



More information about the grass-commit mailing list