GenericMappingTools / GenericMappingTools/gmt

Converting between fill argument and fill structure

Open
#3,700 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

In dealing with issue #3696 I found another problem in how the fill syntax works. In the **coast** version tested in #3696 I build input for **psxy** to plot DCW polygons instead of doing it polygon by polygon because of the hole issue. It fails for ex34 because I parse the pattern argument +gP300/8 and it gets stored in a GMT_FILL struct. However, when I want to do the reverse (write what the structure holds back to a string) it gives me p300/8; notice the lower-case **p**. Per our documentation

> By specifying upper case -GP instead of -Gp the image will be bit-reversed

so while since the p is now P we lost that bit of information.

Internally, when p300/8 is parsed we check for p and if it is p we bit-reverse the image. This seems to contradict the documentation but that might just be an internal thing. However, if that is true then we should write P300/8 on the output, not p. So this is a bit messy but it is clearly a bug that would never be found without the DCW issue! I note that once the image is bit-reversed there is no information left that this occurred. All we know is it is pattern number 8.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.