|
@@ -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;
|
|
|
}
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|