Skip to content
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

Fix errors in gmtspatial related to -N #7746

Merged
merged 3 commits into from
Aug 20, 2023
Merged

Fix errors in gmtspatial related to -N #7746

merged 3 commits into from
Aug 20, 2023

Conversation

PaulWessel
Copy link
Member

See #7745 for background. There were three problems in gmt spatial -N that have been addressed:

  1. Failed to exclude features completely outside the polygon
  2. Flawed implementation of +a could easily failed if the middle point was outside
  3. Failed to turn off output from segments that failed the test

I also added a simple text test called test/gmtspatial/inout_features.sh

Closes #7745.

@PaulWessel PaulWessel added the bug Something isn't working label Aug 20, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Aug 20, 2023
@PaulWessel PaulWessel requested a review from joa-quim August 20, 2023 15:39
@PaulWessel PaulWessel self-assigned this Aug 20, 2023
@PaulWessel PaulWessel merged commit f829247 into master Aug 20, 2023
@PaulWessel PaulWessel deleted the spatial-inside branch August 20, 2023 15:58
@macpurity
Copy link

I appreciate that this issue has been closed, but I now see error messages with -N when specifying +p, without setting a "start" value.

The on-line documentation indicates the +p will default to zero, but this command (part of a much larger piece of code) causes an error message:

echo ${flonlat[@]} | gmt gmtspatial -N${usbdy80k}+p+r

What this line does is determine whether a lon,lat point falls inside a simple conterminous boundary of the USA. This command used to work, but now it issues the following:

gmtspatial [ERROR]: Option -N: Modifier +p given no value

The easy work-around is to specify +p0. Which is what I did to get the script to work properly. If there no longer a default value, then the on-line documentation should be changed.

The on-line documentation currently reads: "or it is assigned the running number that is initialized to start [0]." This suggests that zero is the default value if none is provided.

PaulWessel added a commit that referenced this pull request Nov 14, 2023
Also clarify that +p takes optional argument [0] and allow +p with no args for setting the default.  See #7746.
@PaulWessel PaulWessel mentioned this pull request Nov 14, 2023
@PaulWessel
Copy link
Member Author

Fixed in #8039.

PaulWessel added a commit that referenced this pull request Nov 14, 2023
Also clarify that +p takes optional argument [0] and allow +p with no args for setting the default.  See #7746.
@macpurity
Copy link

Thanks, Paul. That did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gmtspatial -N fails to indentify the points-in-polygon
3 participants