oaksandspokes / raleighbikeways

Raleigh Bikeways
https://map.oaksandspokes.com
The Unlicense
5 stars 2 forks source link

reference or import OSM data #23

Open npdoty opened 4 years ago

npdoty commented 4 years ago

I think leveraging OSM data for the physical infrastructure is a good one, and maybe mixing it with the city data for recommended paths. Cities seem to fluctuate on their update timeliness. Do you want to look into a way to add OSM data updates without any manual effort? I used https://overpass-turbo.eu/ to get all the infrastructure with the query below, but the API does't return in a data format we can use to my knowledge, it has to be converted manually. Maybe a weekly script or something?

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“cycleway=lane or cycleway=left or cycleway=right or highway=cycleway or bicycle=designated or cycleway:right=* or cycleway:left=*”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “cycleway=lane”
  node["cycleway"="lane"]({{bbox}});
  way["cycleway"="lane"]({{bbox}});
  relation["cycleway"="lane"]({{bbox}});
  // query part for: “cycleway=left”
  node["cycleway"="left"]({{bbox}});
  way["cycleway"="left"]({{bbox}});
  relation["cycleway"="left"]({{bbox}});
  // query part for: “cycleway=right”
  node["cycleway"="right"]({{bbox}});
  way["cycleway"="right"]({{bbox}});
  relation["cycleway"="right"]({{bbox}});
  // query part for: “highway=cycleway”
  node["highway"="cycleway"]({{bbox}});
  way["highway"="cycleway"]({{bbox}});
  relation["highway"="cycleway"]({{bbox}});
  // query part for: “bicycle=designated”
  node["bicycle"="designated"]({{bbox}});
  way["bicycle"="designated"]({{bbox}});
  relation["bicycle"="designated"]({{bbox}});
  // query part for: “"cycleway:right"=*”
  node["cycleway:right"]({{bbox}});
  way["cycleway:right"]({{bbox}});
  relation["cycleway:right"]({{bbox}});
  // query part for: “"cycleway:left"=*”
  node["cycleway:left"]({{bbox}});
  way["cycleway:left"]({{bbox}});
  relation["cycleway:left"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Originally posted by @jonathonwpowell in https://github.com/oaksandspokes/raleighbikeways/issues/6#issuecomment-570805831

npdoty commented 4 years ago

Residents can more easily keep the OpenStreetMap definitions more up to date (see the cycle map layer around Durham, for example)

jonathonwpowell commented 4 years ago

@npdoty Currently I am storing some geojson data as gists on github, like here. Seems to work well, just an idea

npdoty commented 4 years ago

This fork uses a geojson export of the relevant OSM data and renders it as bikelanes and greenways: https://github.com/oaksandspokes/raleighbikeways/compare/master...npdoty:master

There are a few areas of inconsistencies; while the OSM data is mostly better, there are some areas (especially footpaths that may or may not be bicycle-designated) that don't show up in this rendering but are in the city Durham bike map. But the OSM data has more of the current painted and protected lanes in Durham. bicycle=yes is the tricky key to work with.

I just included the .geojson file in this repo directly: caching those data files might increase the speed and reliability for all the regions, if we want to move in that direction. But I can also move it to a gist or third-party server if that's preferable. I haven't set up a script for automated updates cause I want to see how it works first.

@jonathonwpowell let me know if you'd like a pull request with this, or if we should take a different approach at all.

oaksandspokes commented 4 years ago

Thanks for putting this together!

First I think for the recommended paths we should leverage the city data, as OSM doesn't really have a good equivalent.

I have been chatting with the Open Data people in Durham and they said they are planning on having an updated data set in the next couple weeks.

For Durham it seems to work great, and I like the idea that we could just have one source instead of multiple for each city. We also likely will have better updates

My concerns are:

I am thinking we wait until Durham updates their data and go from there. What do you think? Do you know of a good way to mark temporary closures of cycleways in OSM?

npdoty commented 4 years ago

There is a specific proposal for mapping temporary closures in OSM, with the specific example of temporary closures of a cycleway due to construction, but I don't know of anything else and that may not be widely used or accepted.

If you're hearing from Durham city staff that there will be more regularly updated data, that's great news! (The last I heard was over the summer that a 2019 map was coming soon, but it sounds like you've got a more detailed answer.)

I'm more confident of the OSM data since residents have some control over it and it's more up-to-date at the moment. The query I used for this fork is specifically limited to the borders of Durham County to prevent overlapping with other administrative divisions which might have other data sources. While there may be some institutional knowledge in the particular dataset for Raleigh, I think the primary value of the project is providing some translation and an equivalence of routes in the different jurisdictions and I think that translation will have to happen no matter where the data comes from.

But I totally agree that we need the city-provided data to get those recommended routes, and there will always be some occasional overlaps or conflicts. Also, people who want to can already see an OpenStreetMap-based cyclemap through openstreetmap.org, opencyclemap.org or CyclOSM -- that last one is pretty good for this purpose, actually, and it's usually only a minute behind the OSM database.

So I'd be fine with waiting to see what Durham provides, or closing this issue altogether if y'all rather not integrate OSM data.

jonathonwpowell commented 4 years ago

I think you may have convinced me. Would you mind putting together a PR with the entire triangle's bike infrastructure to see how it looks?

I reached out to Mapbox, who provide the directions API, and they said they don't currently take into account conditional access into the API yet, they plan to at some point.

jonathonwpowell commented 4 years ago

I have been messing around with the query and have improved it a little: “(maxspeed!="55 mph" and cycleway!=shared_lane) and (cycleway=lane or cycleway=left or cycleway=right or highway=cycleway or cycleway:right= or cycleway:left= or (bicycle=designated and highway=track))”

For bike lanes: (maxspeed!="55 mph" and cycleway!=shared_lane) and (cycleway=lane or cycleway=left or cycleway=right or cycleway:right= or cycleway:left=)

For Greenways: (maxspeed!="55 mph" and cycleway!=shared_lane) and (highway=cycleway or (bicycle=designated and highway=track))

Also Cary keeps breaking their API so we need a way to control it anyway

jonathonwpowell commented 4 years ago

So I have a sorta working branch for data comparison that has data from the whole triangle at : https://5e1bbeb30f2ddb0008fb43ca--adoring-wing-48a930.netlify.com/

Branch it is on https://github.com/jonathonwpowell/raleighbikeways/tree/use-osm-data, I just extended the work that you did

A couple problems I see:

I am going to work on fixing these