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

Make stricter checks on central longitude #7295

Merged
merged 1 commit into from
Mar 5, 2023
Merged

Conversation

PaulWessel
Copy link
Member

There are a few cases where GMT was inconsistent and wrong - we will label these as bugs:

  1. When the user specified a specific central longitude, it is to be respected, and for a global map the w/e borders are set at 180 distance from that longitude.
  2. If not a global map then if the distance from the specified central meridian to either border exceeds 180 then we yield a map region error. Currently, something slightly different may happen if -R's +r is used for rectangular areas.
  3. If no central meridian is set then it continues to default to the mid longitude.

Tests pass and some of the odd and strange plots found in #7291 are now dealt with.

There are a few cases where GMT was inconsistent and wrong - we will label these as bugs:

1. When the user specified a specific central longitude, it is to be respected, and for a global map the w/e borders are set at 180 distance from that longitude.
2. If not a global map then if the distance from the specified central meridian to either border exceeds 180 then we yield a map region error.
3. If no central meridian is set then it continues to default to the mid longitude.
@PaulWessel PaulWessel added the bug Something isn't working label Mar 5, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Mar 5, 2023
@PaulWessel PaulWessel self-assigned this Mar 5, 2023
@seisman
Copy link
Member

seisman commented Mar 5, 2023

The following command no longer works after this PR:

gmt basemap -Bag -Bzag -JR270/10c -Jz5 -R10/70/-5/10/0/1 -p225/30 -pdf map                           
basemap [ERROR]: Western boundary is > 180 degrees from specified central meridian and thus your region is invalid
basemap [ERROR]: General map projection error

@seisman
Copy link
Member

seisman commented Mar 5, 2023

Before this PR was merged, the command produces the following figure. As you can see, the location of the z-axis doesn't match well with the map boundary. Is it intentional?
map

@PaulWessel
Copy link
Member Author

Couple of issues I guess:

  1. Since Winkel Tripel has separate west and east borders, they cannot be more than 180 degrees from the center, and the center longitude cannot be outside the range. This is a new check to prevent crazy situations.
  2. Since no +r is used in setting the region, the sliver of Winkel map given w/e/s/n has variable height. The back wall mechanism has no knowledge of this and will not draw some curved back wall.

Probably best to improve the docs for -B on this.

anbj pushed a commit that referenced this pull request Mar 7, 2023
There are a few cases where GMT was inconsistent and wrong - we will label these as bugs:

1. When the user specified a specific central longitude, it is to be respected, and for a global map the w/e borders are set at 180 distance from that longitude.
2. If not a global map then if the distance from the specified central meridian to either border exceeds 180 then we yield a map region error.
3. If no central meridian is set then it continues to default to the mid longitude.
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 this pull request may close these issues.

3 participants