-
Notifications
You must be signed in to change notification settings - Fork 397
Fix issues in Mercator projection #4120
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
Conversation
…standard parallel Normallly, there is no such thing as Mercator should report relative to Equator. However, when you wish to make a Mercator map centered on a point and give spacial distances then we temporarily need to ability to measure Mercator distances from that point.
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-6.1 6.1
# Navigate to the new working tree
cd .worktrees/backport-6.1
# Create a new branch
git switch --create backport-4120-to-6.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick ca699632c1af6236631f87e4debaac83aec1142c
# Push it to GitHub
git push --set-upstream origin backport-4120-to-6.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-6.1Then, create a pull request where the |
|
Hope @seisman can do this to be safe. |
|
A small conflict when manually backporting this PR to 6.1: ++<<<<<<< HEAD
+ snprintf (buffer, GMT_LEN256, "-R%g/%g/%g/%g -J%s -I -F%c -C -bi2d -bo2d -<%s ->%s --GMT_HISTORY=false",
+ wesn[XLO], wesn[XHI], wesn[YLO], wesn[YHI], Jstring, unit, in_string, out_string);
++=======
+ snprintf (buffer, GMT_LEN256, "-R%g/%g/%g/%g -J%s -I -F%c -C%s -bi2d -bo2d -<%s ->%s --GMT_HISTORY=readonly",
+ wesn[XLO], wesn[XHI], wesn[YLO], wesn[YHI], Jstring, unit, origin_flag, in_string, out_string);
++>>>>>>> ca699632c1... Fix issues in Mercator projection (#4120)We changed some GMT_HISTORY from I think we should accept changes in this PR but still let GMT_HISTORY=false, right? |
* Requires special -C +m modifier to report Mercator units relative to standard parallel Normallly, there is no such thing as Mercator should report relative to Equator. However, when you wish to make a Mercator map centered on a point and give spacial distances then we temporarily need to ability to measure Mercator distances from that point. * Document -C+m * Update gmt_proj.c * Update gmt_proj.c * Update merc_origin.ps
|
Yes, false should be fine for this - that is what it was |
* Requires special -C +m modifier to report Mercator units relative to standard parallel Normallly, there is no such thing as Mercator should report relative to Equator. However, when you wish to make a Mercator map centered on a point and give spacial distances then we temporarily need to ability to measure Mercator distances from that point. * Document -C+m * Update gmt_proj.c * Update gmt_proj.c * Update merc_origin.ps Co-authored-by: Paul Wessel <[email protected]>
Description of proposed changes
There were two problems in the Mercator projection in 6.1.0 that this PR will fix:
With the corrections we are again compatible with 6.0.0 output while handling the relative coordinates for projection setup. For flexibility, we also added a +m modifier to -C in mapproject to allow moving the origin for projected Mercator y-values to the standard latitude [Default remains the Equator].
The recently added merc_origin.ps test changed slightly due to point 2 above.