Find your nearest spot on STRtree

2 answers

JTS 1.13 provides the STRTree.nearestNeighbor method for this operation. I don't know if this has been ported to NTS yet, but if not possible, you can request it.

+2
source

If the only query you need to complete is Get Your Nearest Place, using R-Tree might not be the best choice. I could think of two alternatives:

  • Calculate the distance to each place using the Garveyne formula and find the minimum distance. If you have too many coordinates, this might be the best solution. See " Finding proximity " for more information.
  • Use a data structure that allows you to search for the nearest coordinates, such as KD-Tree . Please note that the KD-Tree implementation in NetTopologySuite is not suitable for your use.
0
source

All Articles