[GRASS-SVN] r55415 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 18 03:25:55 PDT 2013
Author: mmetz
Date: 2013-03-18 03:25:55 -0700 (Mon, 18 Mar 2013)
New Revision: 55415
Modified:
grass/trunk/lib/gis/make_loc.c
Log:
fix #1905
Modified: grass/trunk/lib/gis/make_loc.c
===================================================================
--- grass/trunk/lib/gis/make_loc.c 2013-03-18 08:54:02 UTC (rev 55414)
+++ grass/trunk/lib/gis/make_loc.c 2013-03-18 10:25:55 UTC (rev 55415)
@@ -150,8 +150,10 @@
* \param proj_info2
* \param proj_units2
* \return -1 if not the same projection, -2 if linear unit translation to
- * meters fails, -4 if not the same ellipsoid, -5 if UTM zone differs
- * else TRUE if projections match.
+ * meters fails, -4 if not the same ellipsoid,
+ * -5 if UTM zone differs, -6 if UTM hemisphere differs,
+ * -7 if false easting differs, -8 if false northing differs,
+ * else TRUE if projections match.
*
*/
@@ -227,6 +229,14 @@
return -5;
/* -------------------------------------------------------------------- */
+ /* Hemisphere check specially for UTM */
+ /* -------------------------------------------------------------------- */
+ if (!strcmp(proj1, "utm") && !strcmp(proj2, "utm")
+ && !!G_find_key_value("south", proj_info1)
+ != !!G_find_key_value("south", proj_info2))
+ return -6;
+
+ /* -------------------------------------------------------------------- */
/* Do they both have the same false easting? */
/* -------------------------------------------------------------------- */
@@ -237,7 +247,7 @@
x_0_2 = G_find_key_value("x_0", proj_info2);
if (x_0_1 && x_0_2 && (fabs(atof(x_0_1) - atof(x_0_2)) > 0.000001))
- return -6;
+ return -7;
}
/* -------------------------------------------------------------------- */
@@ -251,7 +261,7 @@
y_0_2 = G_find_key_value("y_0", proj_info2);
if (y_0_1 && y_0_2 && (fabs(atof(y_0_1) - atof(y_0_2)) > 0.000001))
- return -7;
+ return -8;
}
/* -------------------------------------------------------------------- */
More information about the grass-commit
mailing list