[GIS] Using a list of geographic locations, and determining the X closest locations to a user-defined location

cost-pathdistanceexcelgoogle maps

I've got a list of geographical locations in an Excel spreadsheet. I want users to be able to search for a user-defined location, and then have the X number of closest locations from the list pulled up and displayed, sorted by nearest to farthest by travel time via car. I know Excel alone obviously can't do this.

I have minimal/no programming knowledge. Just an Excel tinkerer. I figure that, at a minimum, this would require utilization of a mapping service like Google Maps or Mapquest.

Best Answer

A possible solution would be to use postgresql, postgis, pgrouting and osm2pgrouting.

  • Insert your fixed locations in a postgis database.
  • Insert the real road network in your database for the area that you need with an import of OSM data using osm2pgrouting.
  • Optional: find the closest point on your road network from the user defined location.
  • Use pgrouting to calculate the distance by car from user defined location to all your predefined locations ordered on distance limited by X.

My assumptions:

  • You need the real road network to be able to calculate the driving distance from a user defined location to your fixed locations.
  • Distance from A to B is a good substitute for driving time. This is obviously not always the case but i do not know your specific use case.

Needed skills:

  • What you mainly need with this solution is SQL knowledge.
Related Question