I’ve resurrected some old (GMT ver5) code that simply tested if a point (or points) was inside a polygon (poly.txt). The point gets written to a file (test.txt) and then: gmtspatial <test.txt -Npoly.text+z
This produces zero output.
If I try: gmtspatial <test.txt -Npoly.text+r
The response is: Middle point from table 0 segment 0 is inside polygon # 999
even though there are six test points in the file (five of which are in the polygon).
What does it mean by “middle point”?
How can I get it to simply output the point plus the Z value?
The code worked previously but something has changed somewhere.
GMT 5 is deprecated - see GMT 6.4.0 as latest release. In the documentation for gmt select there is no +r or +z modifier to -N. Even GMT4 does not have that. In 6 I only find
Hi Joaquim.
Made up two files. One (test_poly.txt) a simple rectangular polygon and one (test_points.txt) a line of points crossing boundary of polygon.
gmtspatial <test_points.txt -Ntest_poly.txt+z
? (no response)
gmtspatial <test_points.txt -Ntest_poly.txt+r gmtspatial: Processing input table data Middle point from table 0 segment 0 is inside polygon # 999 gmtspatial: 1 segments found to be inside polygons, 0 were outside and skipped
I have since separated each point in “test_points.txt” with “>”. I get the same message (as above) for each point that is within the polygon, but still cannot get the -N+z option to produce any output.
I didn’t pay attention to the numbers (only if the replied). But indeed, on a quick check with the manual something does not look right.
For in-out tests like these I use gmtselect, and the result is different.
Hi Joaquim,
Sorry for delay. Only work part-time so intermittent with web access.
Also, not computer literate enough to be able to compile and implement new code. Using windows executables.
Russ