Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

My coordinates are projected using the following projection:

proj= {"UTMZone32", {"GridOrigin" -> {500000, 0}, "CentralScaleFactor" -> 0.9996}};

Now I wish to calculate the distance between two points (ignoring elevation), e.g.

p1= GeoGridPosition[{359577, 5.51291*10^6,0}, proj]
p2= GeoGridPosition[{509108, 5.972*10^6,0}, proj]

When I try GeoDistance

GeoDistance[p1,p2]

it fails with the error message

GeoDistance::invparam: "Invalid parameters !(\"GeoGridPosition[{359577, 5.51291*^6, 0}, {\\"UTMZone32\\", {\\"GridOrigin\\" -> {500000, 0}, \\"CentralScaleFactor\\" -> 0.9996}}]\"). "

Also, the GeoPositionXYZ function, as in

GeoPositionXYZ[p1]

fails with the error messages

ToString::nonopt: Options expected (instead of InputForm) beyond position 2 in ToString[None,{GridOrigin->{500000,0},CentralScaleFactor->0.9996},InputForm]. An option must be a rule or a list of rules. >>

GeoGridPosition::invparam: "Invalid parameters ToString[!(None, {\"GridOrigin\" -> {500000, 0}, \"CentralScaleFactor\" -> 0.9996`}, InputForm)]."

GeoPositionXYZ::invcoord: "!(\"GeoPosition[GeoGridPosition[{359577, 5.51291*^6, 0}, {\\"UTMZone32\\", {\\"GridOrigin\\" -> {500000, 0}, \\"CentralScaleFactor\\" -> 0.9996}}]]\") is not a valid coordinate specification."

Both functions work, however, when I switch proj to the string UTMZone32.

Do I need to get the full projection specification to work?

EDIT: After some further googling, I realized that in UTM coordinates the distance between two points is simply

Norm[{p1[[1,1;;2]]-p2[[1,1;;2]]}]

so I would answer my own question with no.

share|improve this question
    
I'm not sure about this, but I think that you can't use {"UTMZone32", {"GridOrigin" -> {500000, 0}, "CentralScaleFactor" -> 0.9996}} as a projection. "UTMZone32" is a defined projection on its own: GeoProjectionData["UTMZone32"] ==> {"TransverseMercator", {"Centering" -> {0, 9}, "CentralScaleFactor" -> 1, "GridOrigin" -> {0, 0}, "ReferenceModel" -> "WGS84"}} Given the centering and scaling you want perhaps you could use proj = {"TransverseMercator", {"GridOrigin" -> {500000, 0}, "CentralScaleFactor" -> 0.9996, "Centering" -> {0, 9}, "ReferenceModel" -> "WGS84"}} –  Sjoerd C. de Vries Jan 23 at 20:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.