<div dir="ltr">Hi there,<div><br></div><div style>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:</div>

<div style><br></div><div style>1) Take table of trip_ids, start points, end points, travel modes and start times from the database</div><div style>2) Export them as a CSV</div><div style>3) Import the CSV to R</div><div style>

4) Use R to loop through the data and send queries off to the Google API.</div><div style>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?</div>

<div style><br></div><div style>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?</div><div style><br></div><div style>Once this is all done I then want to use the routes with another layer to calculate someones exposure to X over each journey.</div>

<div style><br></div><div style>Any general thoughts about this process would be welcome.</div><div style><br></div><div style>Thanks</div><div style><br></div><div style>James</div></div>