-
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
WIP Improve grdcall.c string breaking #5972
base: master
Are you sure you want to change the base?
Conversation
Any thoughts on this, @joa-quim ? We also call gdal_translate in grdcut to write a multi-band TIFF and there we don't need --a_srs so perhaps it might be easier to get grdgdal to do that job? I like the idea of avoiding system calls. |
In the single quotes case when |
That may be the problem. I could try that. meanwhile see #5983 . |
See if this works for you. |
Looks like the single quote recipe is for *nix only. The Patagonia example fails
|
Maybe you could add a WIN33 ifdef to pick the quote needed? I am off for a
few hours.
Paul Wessel, Professor
Dept. of Earth Sciences
SOEST, U of Hawaii at Manoa
…On November 12, 2021 at 7:41:22 AM, Joaquim ***@***.***) wrote:
Looks like the single quote recipe is for *nix only. The Patagonia example
fails
gmt coast -JS-55/-60/15c -R-77/-55/-57.5/-48r -Di -Gred -Bg2 --MAP_FRAME_TYPE=inside -ps patagonia
psconvert patagonia.ps -Tt -W+g -V
...
psconvert [INFORMATION]: Proj4 definition: +proj=stere +lat_0=-60 +lon_0=-55 +k=0.9996 +x_0=0 +y_0=0 +units=m +a=6378137.000 +b=6356752.314 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
psconvert [INFORMATION]: The grdgdal command:
"patagonia.tif" -Atranslate -M -G"patagonia.tiff" -F"-mo TIFFTAG_XRESOLUTION=300 -mo TIFFTAG_YRESOLUTION=300 -a_srs "+proj=stere +lat_0=-60 +lon_0=-55 +k=0.9996 +x_0=0 +y_0=0 +units=m +a=6378137.000 +b=6356752.314 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" -co COMPRESS=LZW -co TILED=YES"
grdgdal [ERROR]: Cannot find file +lat_0
grdgdal [ERROR]: Cannot find file +lat_0
grdgdal [ERROR]: Cannot find file +lon_0
grdgdal [ERROR]: Cannot find file +lon_0
grdgdal [ERROR]: Cannot find file +k
...
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#5972 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGJ7IX5EIPOKWOXUJMXRRSTULVGUFANCNFSM5HWUU7PQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Create_Options are concerned with stuff like -BWesn+t"My title" -Bxa5+l"Some label" I think. However, when grdgdal.c was added, it actually expects a -Margs option where the args are in double quotes and may contains sub-options in single quotes. Is this a correct description of life? If so, yes, then Create_Option needs to be smarter or grdgdal needs to intervene somehow. But first, let me know if the above is correct. |
It's not -M, is -F
From this, I assume yes. But no single quotes, only double. Or if *nix insists all singles on *nix and all doubles on Win. |
So on Windows, if you want to pass a series of options via -F, you need to quote the whole string, but if there are the -a_srs suboptions, you cannot also use double quotes for those, are you? Don't you do
? |
I think this is a not anticipated case. We need to be able to break up the -F string in tokens and the |
Thanks, forgot about how the +proj stuff was handed: We expect no spaces and then they are added in the J internal strings passed out. Seems like we just need to remove them before passing to the next gmt module. |
We should revisit this after 6.3 has been released to see if we can eliminate gdal_translate calls in psconvert and grdcut. |
Description of proposed changes
I changed the quote checking to look for single quotes instead. This keeps the quoted args to
-a_srs
as one item, but something is still not quite right. Perhaps you know what to do next so you can add to this branch: