[postgis-users] Google Directions -> PostGIS

James David Smith james.david.smith at gmail.com
Thu May 16 08:01:46 PDT 2013


Hi there,

This isn't so much a question as such, more a request for opinions and
advice. I was wondering whether anyone had any experience with using the
Google API for getting driving directions/routing - but then storing the
results in a PostgreSQL/PostGIS database. I was thinking that my workflow
might go something like this:

1) Take table of trip_ids, start points, end points, travel modes and start
times from the database
2) Export them as a CSV
3) Import the CSV to R
4) Use R to loop through the data and send queries off to the Google API.
5) The results are a series of polylines each with the geometry as a
polyline, the length of the stage, the time of the stage etc. As a JSON
file. If I could break this apart in it's constiuent parts, could I then
store it back in my PostGIS database?

I guess the hardest bit I can see about this process, is converting the
google encoded polyline to a PostGIS polyline I think. Any thoughts on that?

Once this is all done I then want to use the routes with another layer to
calculate someones exposure to X over each journey.

Any general thoughts about this process would be welcome.

Thanks

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130516/b1e18e6d/attachment.html>


More information about the postgis-users mailing list