Skip to content

Let mapproject report rectangular region that covers an obliquely defined region#5782

Merged
PaulWessel merged 4 commits intomasterfrom
mapproject-rect-area
Sep 19, 2021
Merged

Let mapproject report rectangular region that covers an obliquely defined region#5782
PaulWessel merged 4 commits intomasterfrom
mapproject-rect-area

Conversation

@PaulWessel
Copy link
Member

When we specify an oblique region via an azimuthal perspective projection or the region via -Rw/s/e/n+r, it is hard to know what the corresponding rectangular region is, which can be very useful piece of information for advanced scripting. Here we add modifier r to -W that will report this region; use uppercase R to get a "-Rw/e/s/n" string as trailing text instead. The man page has an example of this. Here are other examples:

gmt mapproject -Rg -JG10/20/1900/0/0/0/170/180/3i -WR
-R-31.2072906633/51.2072895162/-13.2762303233/49.3230415777
-R-31.2072906633/51.2072895162/-13.2762303233/49.3230415777

gmt mapproject -R270/20/305/25+r -JOc280/25.5/22/69/2c -Wr
270	305	9.48892505833	35.6071567812

I do not think we need to add a specific test script for this feature since it is only reflecting internal knowledge.

When we specify a projection and region via an azimuthal perspective projection or an oblique region via -Rw/s/e/n+r, it is hard to know what the corresponding rectangular region is.  Here we add modifier r to -W in mapproject to report that region.
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Sep 19, 2021
@PaulWessel PaulWessel self-assigned this Sep 19, 2021
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Sep 19, 2021
Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Looks good. Note that this is available now regardless of the projection specified, do you want to limit to only oblique projections?

@PaulWessel
Copy link
Member Author

No, I think it is OK that it works for any projection. Even as -R0/30/0/30 -JM6i will just return 0/30/0/30.

@PaulWessel PaulWessel merged commit f6dbc1f into master Sep 19, 2021
@PaulWessel PaulWessel deleted the mapproject-rect-area branch September 19, 2021 20:17
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