[OSRM-talk] Mapping 20,000 bike routes

Nathan Wessel nate.wessel at mail.utoronto.ca
Mon Mar 2 15:17:52 UTC 2020


Hi Chris,

I've done something similar in Python. I just run OSRM locally with the data built using the bike profile, and then make repeated http requests to localhost. Each request takes only about 5 milliseconds, so I haven't needed to parellelize yet. I'm running ~150k requests at a time and it takes a few minutes.

I believe you can request the output as geoJSON, so it's just a matter of parsing the geometry portion of the JSON data returned by OSRM and then exporting all that to whatever format you prefer.

You can check out some of my Python code here: https://github.com/Nate-Wessel/TO-bike-map/blob/master/between.py
There is a shell script in there as well that shows how I start up OSRM and process the OSM data: https://github.com/Nate-Wessel/TO-bike-map/blob/master/update-streets.sh

Hope that helps!

Nate Wessel, PhD
Planner, Cartographer, Transport Nerd
NateWessel.com<https://www.natewessel.com>

On 2020-03-02 10:02 a.m., Chris Willer wrote:
Hi all,

I was wondering if anyone knows the best way to approach this project I'm working on.  I have a csv file with 20,000 start and stop points for a bike share program.  I'm trying to map the fastest bike route for each row.  I program using R and am wondering how if anyone knows how to utilize OSM to map these routes and then extract them as shapefiles.

Any help would be appreciated.

Best,
Chris





_______________________________________________
OSRM-talk mailing list
OSRM-talk at openstreetmap.org<mailto:OSRM-talk at openstreetmap.org>
https://lists.openstreetmap.org/listinfo/osrm-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20200302/541c1b4c/attachment.htm>


More information about the OSRM-talk mailing list