Skip to content

Conversation

@PaulWessel
Copy link
Member

Description of proposed changes

There were two problems in the Mercator projection in 6.1.0 that this PR will fix:

  1. The handling of relative distances around a projection origin in setting up a Mercator map (issue -JM standard parallel ignored #2287) leaked into coordinate projection from mapproject and affected the output of projected values, as reported on the forum.
  2. The conformal rather than geodetic standard latitude was used in computing the true scale at that latitude.

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.

…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.
@PaulWessel PaulWessel added bug Something isn't working backport 6.1 Backport this PR to 6.1 branch labels Aug 30, 2020
@PaulWessel PaulWessel requested review from joa-quim and seisman August 30, 2020 00:31
@PaulWessel PaulWessel self-assigned this Aug 30, 2020
@PaulWessel PaulWessel merged commit ca69963 into master Aug 30, 2020
@PaulWessel PaulWessel deleted the merc-fix branch August 30, 2020 01:01
@github-actions
Copy link
Contributor

The backport to 6.1 failed:

The process 'git' failed with exit code 1

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

Then, create a pull request where the base branch is 6.1 and the compare/head branch is backport-4120-to-6.1.

@PaulWessel
Copy link
Member Author

Hope @seisman can do this to be safe.

@seisman
Copy link
Member

seisman commented Aug 30, 2020

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 false to readonly in PR #3687, but it wasn't backported to 6.1.

I think we should accept changes in this PR but still let GMT_HISTORY=false, right?

seisman pushed a commit that referenced this pull request Aug 30, 2020
* 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
@PaulWessel
Copy link
Member Author

Yes, false should be fine for this - that is what it was

PaulWessel added a commit that referenced this pull request Aug 30, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 6.1 Backport this PR to 6.1 branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants