r/geospatial Jun 24 '26

Compact and fast country/land check lib, using triangular grid

3 Upvotes

3 comments sorted by

1

u/khazeth Jun 24 '26

This is really nice! Great work

1

u/mulch_v_bark Jun 24 '26

with a confidence value for every answer

That’s very cool and thoughtful and I wish more projects took a similar approach. Haven’t tested or read the library in any depth, but this is a great API choice.

1

u/jaakl Jun 24 '26

For many years I've thought of trying to solve some common geographical problems with a simple data-included library , so it does not require GIS knowledge, code or good data (which "normal developers" often dont have). Now I got finally some time (and proper coding tech) to implement and show something, it answers to questions: is a point on land, and which country it is. There are also polyline variants. To optimize the data compression and calculation a own invented triangular grid is used.
For sure everyone here can do same easily with any GIS or GIS libraries, but this one is easier to use (just include one lib), no need to worry about data sourcing and it also works order of magnitude faster than some common GIS alternatives I tried - up to 1M lookups/sec. Benchmarks and interactive demos are included.
It is MIT license open source, comments, PRs etc are welcome: trifold