-
Notifications
You must be signed in to change notification settings - Fork 348
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
Enhance mapproject to give closed domain polygons #6673
Conversation
This PR follows up a bit on the one earlier today () by adding an optional modifier +n to -We or -Wr. This will build a closed polygon outline of the oblique regions. For -Wr that is the interior oblique region while for -We it is the encompassing oblique region. I have then added a documentation figure to mapproject -W to explain the purpose of these and why they are different.
I'm a bit confuse still. Andreas wanted to get a -R option, which I also missed time to time for the right case, but this PR outputs a polygon only, not an -R string. |
If you just want a -R string you use -WE (or -WR). See examples. |
OK. And the KEY? |
Right, I gotta look at the KEY. Hold a sec... |
I think KEYS are fine: There is always output to stdout here >D}, and -W turns off any input as always. |
Something is not write. These both come out with nothing on CLI
and while this work on Julia the content is strange
and this crashes Julia
|
Please check if on the right branch first. I cannot understand why the two CLI lines would fail since that works here. But if not on the very latest commit in that branch then I can understand it. |
I'm running in Xcode with malloc guards on and not exceeding any limits. |
Both commands in Julia works fine here - I think you need to updated and rebuild. |
I did update some 5 min ago. |
Well, all I can say is it runs on CLI and Julia here. Guard Malloc finds nothing unusual. But one of my last commits did address a memory counter issue - so hence my question. |
nope, not that. git tells me that I'm on the latest change. |
OK, then I need your help for a hint for what is going on. |
We have seen this before. XCode simply doesn't detect all cases like this. VS does. |
Well, I had it right the very first time, but then I decided I need to close the polygon (but was already closed) so now we got one too many, See how this goes. |
Wrong button. |
Still crashes.
it no longer crashes but prints the last point duplicated.
|
How do you get a duplicate after I remove that code? |
Sorry, I had updated but maybe too quick. It not seems to work. |
I will make one more change just to ensure the first and last are exact. As it is the last is subject to some rounding. |
OK, I have done my last update. |
So in Julia it kind of works but it's printing the result to stdout
The dataset, that should hold the output, is empty. The result was printed to std... |
Maybe I need to do something more here. All of mapproject writes to stdout so not sure why this is different in the wrappers. You've used mapproject for other things in Julia like this and it returnds via the memory, right? |
Yes. |
Also fix bad mode
How about now? I had a wrong mode passed in GMT_Write_Data and I think that is is - but I also added Ctrl->Out.file like other modules. |
Yes, now it works. |
Gerat. I will go through the table produces and see if any of them do not use Out.file (without that and the parsing, any external cannot do ->OUtfile, for instance). |
This PR follows up a bit on the one earlier today (#6669) by adding an optional modifier +n to -We or -Wr. This combination will build a closed polygon outline of the oblique regions (red lines). For -Wr that is the interior oblique region (left) while for -We it is the encompassing oblique region (right). I have then added a documentation figure to mapproject -W to explain the purpose of these and why they are different:
Note the solid outlines in the figures are simple geographic polygons made of just meridians and parallels so these are never created since GMT can plot these as is (e.g., plot -Ap)
Oblique polygon for an oblique projection:
gmt mapproject -R270/20/305/25+r -JOc280/25.5/22/69/5c -Wr+n > geo.txt
Polygon for a non-oblique projections encompassing polygon:
gmt mapproject -R-15/60/68/90 -JS36/90/5c -We+n > geo.txt