Update
Apology: I read the post mentioned above incorrectly. The "157 m difference" has to do with the difference between the Euclidean distance using the UTM coordinate system and the geodesic distance (from GeoDistance
) rather than the distance between the two locations. The two points in question are over 480 km apart and with any 3D-to-2D map projection, the farther apart two locations are the farther apart are any measures between those two locations. In this case a difference in 157 m is small (about 0.03 percent) compared to the distance between the locations. That's just what can happen with any map projection.
End of Update
The UTM locations given in the post you mention (with coordinates {359577, 5.51291*10^6}
and {509108, 5.972*10^6}
) are simply not 157 m apart. But here is how to get UTM coordinates and the distance between two locations:
(* Two locations {latitude,longitude} in degrees *)
loc1 = {49.7021, 7.0422}
loc2 = {49.701, 7.0420}
(* Convert to UTM Zone 32 coordinates *)
utm1 = GeoGridPosition[GeoPosition[loc1], "UTMZone32"]
(* GeoGridPosition[{358829.5878969211`,5.507349541635585*10^6}, "UTMZone32"] *)
utm2 = GeoGridPosition[GeoPosition[loc2], "UTMZone32"]
(* GeoGridPosition[{358811.97903316177`,5.5072276325212475*10^6}, "UTMZone32"] *)
(* Find distance between the two locations *)
UnitConvert[GeoDistance[loc1, loc2], "meters"]
(* 123.19340149964208 m *)
UnitConvert[GeoDistance[utm1, utm2], "meters"]
(* 123.1934014982296 m *)
Norm[utm1[[1]] - utm2[[1]]]
(* 123.17428401031748 *)
If you start out with UTM's in meters from Zone 32, then you can find the distance between the two locations with
xy1 = GeoGridPosition[{358829.5878969211, 5.507349541635585*10^6}, "UTMZone32"]
xy2 = GeoGridPosition[{358811.97903316177, 5.5072276325212475*10^6}, "UTMZone32"]
UnitConvert[GeoDistance[xy1, xy2], "meters"]
GeoDistance[]
fails? $\endgroup$