SQLite Forum

Country-coding from Lat/Long, using GeoPoly and/or R-Tree
Login
Hi,

I have tables of geometrical objects, with Latitude/Longitude coordinates,  
and we'd like to filter that data by **countries**.  Given a set of polygons  
for countries, and [SQLite's GeoPoly](https://www.sqlite.org/geopoly.html) extension, it seems like this should be relatively easy.

1) Has anyone done that, and could share experience?
2) Where did you get the country boudaries? At which resolution?
3) Can the *lat/lon is within country X* be done efficiently using indexes? Perhaps an R-Tree index, for pre-filtering?
4) For *borderline* lat/lon, can nearby countries be returned as well?
5) How about perform? What should I watch out for?

At this point, I'm just looking for community advise before diving into  
this myself, as I'm never used R-Tree and GeoPoly with SQLite. TIA, --DD