Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-51

Pluggable Distance Calculation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Referencing
    • None

    Description

      The distance calculation is done in several places. I think it shouldn't be a static helper method instead it should be an instance which could be replaced by a more precise or faster calculations:

      double distance(double latFrom, double lonFrom, double latTo, double lonTo)

      E.g. one could use euclidean distance, haversine calculation or a fast projection calulation (https://github.com/karussell/GraphHopper/blob/master/core/src/main/java/de/jetsli/graph/util/ApproxCalcDistance.java + see test).

      Also one should think about "normed" distances. I mean, if one does not need the actual distance and rather needs to compare distances one could avoid parts of the distance calculation and make it faster. e.g.:

      sqrt(deltaX*deltaX + deltaY*deltaY) then gets: deltaX*deltaX + deltaY*deltaY and the comparisons of distances are still correct if done for all distances (eg. in a quad-tree). This could be done with a separate normedDistance method or probably just the same and a different implementation? Not sure ...

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              peathal Peter Karich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified