I want to create a large database of GPS coordinates that can be queried by saying \"Return all coordinates that are within \'n\' metres of [this coordinate]\".
I need i
GIS databases (e.g. PostgreSQL with PostGIS) actually provide data structures for two- or three dimensional region-searches (spatial indices). The simplest one is the grid index, then the different search trees (kd-tree, quad-tree) with R-tree as the most frequently used (a generalized B-tree for more dimensions). These methods seem adequate.
A basic grid-index (partitioning the space into grid-cells, and searching only in the nearby cells) can be implemented easily and can reduce the search time significantly. Search trees are a bit harder to implement, but there are lots of open-source implementations for lots of programming languages and DBs (like PostGIS or Geopandas etc.). Using them for problems like this one usually pays off.