[GRASS-SVN] r71630 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 3 01:17:55 PDT 2017
Author: mmetz
Date: 2017-11-03 01:17:55 -0700 (Fri, 03 Nov 2017)
New Revision: 71630
Modified:
grass/trunk/lib/gis/make_loc.c
Log:
gislib, G_compare_projections(): compare unit names only if there is no to meter conversion factor
Modified: grass/trunk/lib/gis/make_loc.c
===================================================================
--- grass/trunk/lib/gis/make_loc.c 2017-11-02 16:38:17 UTC (rev 71629)
+++ grass/trunk/lib/gis/make_loc.c 2017-11-03 08:17:55 UTC (rev 71630)
@@ -157,7 +157,9 @@
if (a1 && a2 && (fabs(a2 - a1) > 0.000001))
return -2;
}
- {
+ /* compare unit name only if there is no to meter conversion factor */
+ if (G_find_key_value("meters", proj_units1) == NULL ||
+ G_find_key_value("meters", proj_units2) == NULL) {
const char *u_1 = NULL, *u_2 = NULL;
u_1 = G_find_key_value("unit", proj_units1);
@@ -166,6 +168,12 @@
if ((u_1 && !u_2) || (!u_1 && u_2))
return -2;
+ /* the unit name can be arbitrary: the following can be the same
+ * us-ft (proj.4 keyword)
+ * U.S. Surveyor's Foot (proj.4 name)
+ * US survey foot (WKT)
+ * Foot_US (WKT)
+ */
if (u_1 && u_2 && G_strcasecmp(u_1, u_2))
return -2;
}
More information about the grass-commit
mailing list