-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UTM zones in GMT Documentation are actually MGRS zones + associated confusion #8623
Comments
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute! Please make sure you read our Contributing Guide and abide by our Code of Conduct. |
Hello Ben, Thank you very much for this complete bug report. We are a bit busy working on materials for the AGU, so advances on this may be slow. But I'm going to ask you to split this issue in parts otherwise it will quickly get confusing to address its sub-items. Another thing is, could update to GMT6.5? Or even better, can you build from source code? Two quick answers. EPSG's are allowed and documented at the end of -J but likely their implementation for -R...+ue is probably faulty or even missing at all. -Ju|U doesn't need a + in
|
Hi Joaquim, thanks for your fast reply and hope AGU goes well. Thanks for pointing out that -JEPSG works in mapproject, that makes more sense that it threw a -R error then. I will raise each of the issues I listed above as new issues in github and link the issue numbers to this report. I was lazy and just got the latest version from apt-get prior to making this report, but I will do as you suggest and build from source before creating the new issues. Maybe you could add a documentation tag to this issue thread so the UTM/MGRS stuff distinction can be made? (I don't see a way for me to add these tags) |
This is all pretty low priority and it's a bit extreme to call them bugs, putting this here as a record and for people like me who got confused. May try to do some of the Doc updating myself if I can figure out how.
Suggested fixes (the tldr)
--- I can't do the below ----
-Ju34/1:xxxxx
and throw an error along the lines ofERROR: UTM projection insufficiently specified - did you forget to add a latitude code or +/-?
because at the moment the error message implies the -R value is wrong.Description of the problems in detail
I have had a few related issues with how UTM coordinates get handled in GMT. I'm happy to handle some of the documentation changes myself if I can, but recording them all here as an issue so it's formalised.
GMT documentation on UTM refers to latitude zones that don't appear in GIS software such as QGIS or packages such as PROJ, or in the EPSG system. It turns out these latitude zones are a feature in the US Army's MGRS grid system, so not really a UTM feature. It might be good to make this clear because UTM zones are split into north (N) and south (S) of the equator in other GIS software, and confusingly MGRS has those letters as latitude zones, but both are north of the equator! Modifying the documentation to point out this difference will save a lot of confusion for newer users. Good article on the difference between UTM and MGRS here.
ISSUE 1
In the GMT documentation on UTM it says
and
This only works in the north if you use a "+" (
-Ju+31/1:xxxxx
) if you leave it blank (-Ju31/1:xxxx
) and assume that counts as a "positive number" you get thrown a misleading -R parsing error:I suggest adding a line in the documentation to explicitly say "you need a plus when not specifying a MGRS latitude zone north of the equator".
ISSUE 2
If using data projected in EPSG:32631 (UTM 31N) you get some weird effects
-
Ju31(N-Z)
-- correct for all zone specifications-
Ju31(A-M)
-- incorrect for all zone specifications (thinks you're in the southern hemisphere)This is probably not a priority because if someone just looks at the chart and uses a MGRS zone that is approximately right, then it works! But it is confusing.
I suggest updating documentation to state the difference between UTM and MGRS and that MGRS codes have nothing to do with UTM as understood by most GIS software.
ISSUE 3
Specifying your projection using the EPSG code you projected it into doesn't work, but it's difficult to tell if this is because EPSG codes are not supported, or if the -R argument is wrong:
Using:
-J"EPSG:32631/1:650000"
Results in a similar misleading -R parsing error for Issue 1 (you get a similar error if you try to do it with
-R${gridfile}
like in Example 28)I suggest routines that either catch people using EPSG codes and telling them it's not allowed, or updating documentation to reflect how they actually work, because I don't understand how this is insufficiently specified.
Code to replicate these issues:
Here is some code that replicates these issues, with a small DEM attached, projected into EPSG:32631 (UTM 31N)
test_dem.zip
The text was updated successfully, but these errors were encountered: