Skip to content
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

gmtinfo - extended regions are not correctly output with -C #8412

Closed
jaltekruse-usgs opened this issue Mar 21, 2024 · 2 comments · Fixed by #8416
Closed

gmtinfo - extended regions are not correctly output with -C #8412

jaltekruse-usgs opened this issue Mar 21, 2024 · 2 comments · Fixed by #8416
Labels
bug Something isn't working

Comments

@jaltekruse-usgs
Copy link

Extending the region with gmt info was fixed in PR #7460 and it seems to work as expected. However, if the -C flag is used to output values in columns instead of -Rwest/east/south/north format, the unextended region is returned.

Full script that generated the error

Expanding the test case in #7460:

cat << EOF > data.txt
-125	37.6
-111.1	49.2
-121.49	42.5
EOF
# 0. Exact extent
gmt info data.txt -Ie > result.txt
gmt info data.txt -Ie -C >> result.txt
# 1. Round to nearest 0.5
gmt info data.txt -I0.5 >> result.txt
gmt info data.txt -I0.5 -C >> result.txt
# 2. Extend outward by 1, then round to nearest 0.5
gmt info data.txt -I0.5+R1 >> result.txt
gmt info data.txt -I0.5+R1 -C >> result.txt
# 3. Round to nearest 0.5, then round to nearest 1
gmt info data.txt -I0.5+r1 >> result.txt
gmt info data.txt -I0.5+r1 -C >> result.txt
# 4. Round to nearest 0.5, then extend by 1
gmt info data.txt -I0.5+e1 >> result.txt
gmt info data.txt -I0.5+e1 -C >> result.txt

On macOS 13.6.5, gmt 6.5.0, this gives:

-R-125/-111.1/37.6/49.2
-125	-111.1	37.6	49.2
-R-125/-111/37.5/49.5
-125	-111	37.5	49.5
-R-126/-110/36.5/50.5
-125	-111	37.5	49.5
-R-125/-111/37/50
-125	-111	37.5	49.5
-R-126/-110/37/50
-125	-111	37.5	49.5

And I believe this is the correct output:

-R-125/-111.1/37.6/49.2
-125	-111.1	37.6	49.2
-R-125/-111/37.5/49.5
-125	-111	37.5	49.5
-R-126/-110/36.5/50.5
-126	-110	36.5	50.5
-R-125/-111/37/50
-125	-111	37	50
-R-126/-110/37/50
-126	-110	37	50
@jaltekruse-usgs jaltekruse-usgs added the bug Something isn't working label Mar 21, 2024
Copy link

welcome bot commented Mar 21, 2024

👋 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.

@joa-quim
Copy link
Member

Thanks, I've committed a fix in #8416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants