Skip to content

Fix issue "Oblique projection (Ob): Partly wrong annotations" - #9160

Open
joa-quim wants to merge 2 commits into
masterfrom
issue-8418
Open

Fix issue "Oblique projection (Ob): Partly wrong annotations"#9160
joa-quim wants to merge 2 commits into
masterfrom
issue-8418

Conversation

@joa-quim

Copy link
Copy Markdown
Member

@yvonnefroehlich Can you please test this? I only drived the agents but honestly didn't even tried to understand the bug entirely.

Fix #8418

Assisted-by: GPT Terra and reviewed/corrected by Claude Opus 5.0

joa-quim and others added 2 commits August 25, 2026 19:57
Two independent defects produce the reported symptoms.

Placement: with MAP_ANNOT_OBLIQUE's tick_extend the annotation is put at the
tip of the tick extended along the gridline, so gmtplot_map_symbol divides its
offset by the sine or cosine of the angle at which the gridline meets the
border.  gmtplot_map_tick refuses to draw such a tick once that angle drops
below MAP_ANNOT_MIN_ANGLE, but gmtplot_map_symbol divided anyway: for a shallow
crossing the offset blows up and the label lands far along the border, detached
from its crossing, with no tick to connect them.  On case I of the report the
175E annotation was drawn at 2.0 cm instead of 3.14 cm, and 55N at -0.3 cm,
outside a 6 cm wide border.  Below the minimum angle the annotation now steps
straight out from the border and stays at the crossing.

Default: GMT 6.1.0 defaulted MAP_ANNOT_OBLIQUE to anywhere, but the anywhere
bit was dropped when the setting became a keyword list, leaving the effective
default at separate - longitudes only on S/N, latitudes only on W/E.  That is
fine while the graticule roughly follows the frame, which is exactly what an
oblique frame does not do: in case II the parallels cross the top and bottom
borders and the meridians the left and right ones, so nearly every annotation
was thrown away.  The documentation has always said the default is anywhere.

Note: psxy/rotrectangle, psxyz/rotrectangle and windbarbs/grdbarb_02 gain
annotations and ticks from the default change and need new baselines; the other
37 PS files from tests touching -JO, +r regions or MAP_ANNOT_OBLIQUE are
byte-identical.

test/psbasemap/oblique_annot.sh reads the annotation positions out of the
PostScript and compares them with crossings computed via mapproject, so it
needs no PS baseline.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@joa-quim
joa-quim requested review from a team and yvonnefroehlich August 27, 2026 19:29
@Esteban82

Copy link
Copy Markdown
Member

I think it works. I got these figures:

lon_lat lon_lat_v_02

@Esteban82 Esteban82 added add-changelog Add PR to the changelog AI-assisted All (or most) of the code was written by Artificial Intelligence. labels Aug 28, 2026
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 AI-assisted All (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oblique projection (Ob): Partly wrong annotations

2 participants