Skip to content

text: Add a new modifier to -D (-D+f<file>) - #8965

Merged
joa-quim merged 4 commits into
masterfrom
text-var-offsets
Apr 6, 2026
Merged

joa-quim merged 4 commits into
masterfrom
text-var-offsets

Conversation

@joa-quim

@joa-quim joa-quim commented Apr 5, 2026 •

Copy link
Copy Markdown
Member
  • Add new modifier +f to the -D option of text/pstext
  • The file contains one (dx, dy) pair per text record, allowing each label to have its own displacement instead of a single fixed offset
  • File reading uses GMT_Read_Data so the feature works transparently with GMT.jl in-memory datasets (virtual files)
  • Values in the file are in the current length unit (PROJ_LENGTH_UNIT)
  • Added shell test test/pstext/var_offset.sh

Example

  # offsets.txt has one dx,dy per label
  gmt text -R... -J... -F+f12p+jCM -D0+foffsets.txt << EOF
  -3  -3  SW corner
   3   3  NE corner
  EOF

Mostly written by Claude.

@joa-quim
joa-quim requested a review from a team April 5, 2026 22:13
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added test/baseline/pstext/var_offset.ps
modified test/baseline/pstext/

Image diff(s)

Details

Added images

  • test/baseline/pstext/var_offset.png

Modified images

Path Old New

Report last updated at commit ef6fc0b

@remkos remkos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. I see that en passant you fixed a few other things.

@joa-quim

joa-quim commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

OK I'll merge it, but I will need that some change the mode of the var_offset.sh script.

@joa-quim
joa-quim merged commit 7e40e67 into master Apr 6, 2026
10 of 15 checks passed
@joa-quim
joa-quim deleted the text-var-offsets branch April 6, 2026 10:28
@Esteban82 Esteban82 added enhancement Improving an existing feature add-changelog Add PR to the changelog labels Apr 6, 2026
@Esteban82

Copy link
Copy Markdown
Member

Just for the record, I run the test and looks good to me.

@seisman seisman changed the title Add a new modifier to -D (-D+f<file>) text: Add a new modifier to -D (-D+f<file>) Apr 7, 2026
@seisman

seisman commented Apr 7, 2026

Copy link
Copy Markdown
Member

PR titles would be more informative if they adopted a format such as

module: description of the change.

@seisman

seisman commented May 27, 2026

Copy link
Copy Markdown
Member

Sorry for commenting on a closed PR, but why not put dx, dy directly in the same input file, i.e., the input file has the following columns:

x y dx dy text

@joa-quim

Copy link
Copy Markdown
Member Author

Hmm, I'll need to re-dive on this to remember why things were done the way they were.

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.

4 participants