
Ask HN: What are some geospatial tools I can use to solve this problem? - gnikflow
I&#x27;m the tech lead on a new project that is out of my domain experience. At my company we have a fleet of drivers who checkin via an app with their lat&#x2F;lng coordinates. We have pickup locations (whose locations are already known) and dropoff locations (whose locations are not known until an order is placed). We have a google maps for business license so we can query for directions with traffic durations and address to lat&#x2F;lng. The key problems this service needs to solve are:<p>1) Given a new order, who will be the fastest driver to arrive at the pickup?<p>2) Use our own historical driver data to estimate drive times in the future.<p>3) Caching and solving similar problems<p>4) In general, using our own data so we are not just querying google for everything<p>So far I&#x27;ve looked at postgis, simple caching in redis, redis-geo, and solr spatial search. I&#x27;m just curious if anyone has any ideas on the topic. Thanks!
======
bradleysmith
pgRouting[0] is an extension for PostGIS that provides some routing functions.

looks like they had a further extension solving a very similar problem (Dial-
a-ride-problem, DARP[1]) in their 1.x versions. I can't find it in their
current docs, but it may be just an issue of how the reference it. Take a look
through their stuff, it sounds like it'd be very helpful.

[0] - [http://pgrouting.org/](http://pgrouting.org/) [1] -
[http://gis.stackexchange.com/questions/5330/route-
optimisati...](http://gis.stackexchange.com/questions/5330/route-optimisation-
for-multiple-vehicles) (see first answer)

------
gt565k
If you want to do it in-house, you can geocode the customer addresses through
geocoder (using Google's API) and use SOLR or elastic search to store the
latitude and longitude, then do geospatial queries with all the drivers'
current coordinates to find the closest driver.

I believe SOLR can handle pretty fast indexing with soft commits, so latency
of indexing new records shouldn't be an issue. Not sure about elastic search.

You can always pay Google

Google Distance Matrix:
[https://developers.google.com/maps/documentation/distancemat...](https://developers.google.com/maps/documentation/distancematrix/)

------
andsmi2
Postgis probably easiest/best overall. You don't need to do routing or TSM? In
a native form for one use spatialite works.

The routing piece is the hardest. But if you don't have to do that then you
just need something that stores groupings. For that matter if the points are a
finite list that gets loaded as new then you don't even really need to store
it as spatial data. Just list of drivers, destinations, times and you should
be able to determine who gets where fastest.

------
ant6n
osm

~~~
andsmi2
OSM if you mean open street map is just display. Osrm-- open street routing
might work if you need routing. But postgis has routing modules and you could
call Google for the routes and store.

