Selaa lähdekoodia

fix https://trac.osgeo.org/grass/ticket/1905

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55415 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 vuotta sitten
vanhempi
commit
5d38bfc1b2
1 muutettua tiedostoa jossa 14 lisäystä ja 4 poistoa
  1. 14 4
      lib/gis/make_loc.c

+ 14 - 4
lib/gis/make_loc.c

@@ -150,8 +150,10 @@ int G_make_location(const char *location_name,
  *  \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 @@ G_compare_projections(const struct Key_Value *proj_info1,
 	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 @@ G_compare_projections(const struct Key_Value *proj_info1,
 	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 @@ G_compare_projections(const struct Key_Value *proj_info1,
 	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;
     }
 
     /* -------------------------------------------------------------------- */