GMT error message: Failure to open virtual file

There seem to be several issues in this error.

First, your GMT version is no doubt 6.5+ (that’s what gets installed by ] add GMT).

Now, by the error description it smells a memory leak in the GMT lib, which is not easy to track.

BUT, by crazy coincidence I happen to to be working on the inwhichpolygon function and speed it up by a factor of ~100 when calling it with many query points, and it also now uses a pure Julia function instead of calling the GMT C lib. So, if that was the cause of error it should hopefully avoid it now. Please try the GMT.jl master version to see if fixes it.

Regarding the issue of saving the triangulation file. Don’t know if JLD2 causes some issue, but you can try to use gmtwrite to save the triangulation and gmtread to read it back.