-
Notifications
You must be signed in to change notification settings - Fork 401
Allow format flags F and G in FORMAT_GEO_MAP to come first or last #7215
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
Conversation
See #5153 for background. This PR seeks to implement that scheme.
|
I am thinking perhaps we either ban outright or warn that if FORMAT_GEO_OUT uses G (which adds a space) then the output is not compatible with GMT data format anymore and cannot be recognised properly: Output is geographic but because of G has that extra space between numbers and suffices. If we then try to read that back in: We cannot get past the columns with just a W or E and the whole thing becomes just trailing text as is. I see no use for this. What do you think: Prevent it or just warn when parsing FORMAT_GEO_OUT? I guess the latter is the most flexible since you may want to format a data set for a completely other non-GMT use. |
|
Hi Paul, leading When using |
I agree with you and would just warn. While I mostly use floating point for the internal stuff there might be non-GMT use cases where this could be desirable. |
|
Thanks @KristofKoch. For now, I have added checks for multiple F, G or combinations and they get the general error message (there are too many error possibilities we check for to give individual messages). I now warn if you use trailing G in FORMAT_GEO_OUT since it adds that space. For now, since the output function does not yet handle pre-number hemisphere I have just added commented-out warning to remind me to eventually let GMT write out the bad format and open this message. |
KristofKoch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. That error message gives me a nice starting point for investigating what I screwed up. Thank you, @PaulWessel!
See #5153 for background. This PR seeks to implement that scheme. The FORMAT_GEO_OUT documentation now explains that the F and G can be used with FORMAT_GEO_MAP as either prefix or suffix. Seems to work but need @KristofKoch to give it a better test. Note that it does not work with FORMAT_GEO_OUT since the result would be data that GMT would only recognise as text (since it starts with a letter). If there is a need to produce data output like
then we would need to recognise the above as valid data ascii input when reading it. Not sure if we want to go that road yet.
Example:
gmt basemap -R-1/1/-1/1 -JM15c -Baf -png map --FORMAT_GEO_MAP=Gddd.mmWe should probably add a test. I can imagine a 2x2 subplot with this example using F and G as suffix or prefix which gives 4 cases.