Skip to content

Let mapproject also find encompassing rectangular regions for non-oblique projections#6669

Merged
PaulWessel merged 3 commits intomasterfrom
mapproject-encompass
May 5, 2022
Merged

Let mapproject also find encompassing rectangular regions for non-oblique projections#6669
PaulWessel merged 3 commits intomasterfrom
mapproject-encompass

Conversation

@PaulWessel
Copy link
Member

See this forum post for background. What is needed is -We or -WE, hereby implemented. Now, @anbj can run

gmt mapproject -JS36/90/30c -R-15/60/68/90 -WE

and get his

-R-1.852421104674526/62.33269965938534/126/80.96267731894207+r

See this forum post for background.  What is needed is -We or -WE, hereby implemented.  Now, one can run

gmt mapproject -JS36/90/30c -R-15/60/68/90 -WE

and get

-R-1.852421104674526/62.33269965938534/126/80.96267731894207+r
@PaulWessel PaulWessel added the enhancement Improving an existing feature label May 5, 2022
@PaulWessel PaulWessel added this to the 6.4.0 milestone May 5, 2022
@PaulWessel PaulWessel requested review from anbj and joa-quim May 5, 2022 09:27
@PaulWessel PaulWessel self-assigned this May 5, 2022
Copy link
Contributor

@anbj anbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's like Christmas, just in May.

@anbj
Copy link
Contributor

anbj commented May 5, 2022

This is great Paul, thanks alot.

I find it strange that I'm the first one(?) to nag enough about this to get it implemented. Guess confusion can sometimes lead to great things.

@anbj
Copy link
Contributor

anbj commented May 5, 2022

Note to self and a 'fun' observation; I see that the rounding off is different between the two methods

-R-1.85242110467/62.3326996594/126/80.9626773189+r             # from gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn0/0 and gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn1/1
-R-1.852421104674526/62.33269965938534/126/80.96267731894207+r # from gmt mapproject -JS36/90/30c -R-15/60/68/90 -WE

@PaulWessel
Copy link
Member Author

Sometimes one finds oneself on a train with nothing to do but hack away.

@PaulWessel
Copy link
Member Author

Note to self and a 'fun' observation; I see that the rounding off is different between the two methods

-R-1.85242110467/62.3326996594/126/80.9626773189+r             # from gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn0/0 and gmt mapproject -JS36/90/30c -R-15/60/68/90 -Wn1/1
-R-1.852421104674526/62.33269965938534/126/80.96267731894207+r # from gmt mapproject -JS36/90/30c -R-15/60/68/90 -WE

This is because the -Wn method involves a multiplication of the rectangular extent by the factor "1" which in a computer is not 1 but perhaps 1 + 2e-12 and hence that extra multiplication will mess with insignificant digits down the line.

@PaulWessel PaulWessel merged commit 7d87614 into master May 5, 2022
@PaulWessel PaulWessel deleted the mapproject-encompass branch May 5, 2022 10:11
@PaulWessel PaulWessel added the add-changelog Add PR to the changelog label May 5, 2022
@anbj
Copy link
Contributor

anbj commented May 5, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants