GIScience / openrouteservice

🌍 The open source route planner api with plenty of features.
https://openrouteservice.org
GNU General Public License v3.0
1.33k stars 379 forks source link

Ways tagged as `highway=construction` not considered for bike profiles #1804

Closed TheGreatRefrigerator closed 4 weeks ago

TheGreatRefrigerator commented 1 month ago

Is there an existing issue for this?

Where did you encounter this issue?

live API, self-hosted instance

Request URL

https://api.openrouteservice.org/v2/directions/cycling-regular/geojson

POST Request Body

{"coordinates":[[6.967670917510987,50.98518039417317],[6.969945430755616,50.985450554654086]],"elevation":true,"instructions_format":"html","extra_info":["surface","steepness","waytype"],"language":"en","units":"km","preference":"recommended"}

Response

Response ```JSON {"type":"FeatureCollection","bbox":[6.966556,50.969586,40.0,6.991784,50.985869,51.0],"features":[{"bbox":[6.966556,50.969586,40.0,6.991784,50.985869,51.0],"type":"Feature","properties":{"ascent":26.5,"descent":30.0,"segments":[{"distance":5.456,"duration":1092.8,"steps":[{"distance":0.127,"duration":27.0,"type":11,"instruction":"Head southwest","name":"-","way_points":[0,10]},{"distance":0.414,"duration":82.8,"type":0,"instruction":"Turn left onto Niehler Damm","name":"Niehler Damm","way_points":[10,19]},{"distance":0.03,"duration":6.0,"type":5,"instruction":"Turn slight right onto Niehler Damm","name":"Niehler Damm","way_points":[19,20]},{"distance":0.036,"duration":7.2,"type":0,"instruction":"Turn left","name":"-","way_points":[20,24]},{"distance":0.594,"duration":118.8,"type":1,"instruction":"Turn right","name":"-","way_points":[24,35]},{"distance":0.069,"duration":13.8,"type":13,"instruction":"Keep right","name":"-","way_points":[35,36]},{"distance":0.204,"duration":40.7,"type":13,"instruction":"Keep right","name":"-","way_points":[36,39]},{"distance":0.523,"duration":104.6,"type":12,"instruction":"Keep left","name":"-","way_points":[39,53]},{"distance":0.149,"duration":29.8,"type":13,"instruction":"Keep right","name":"-","way_points":[53,56]},{"distance":0.709,"duration":141.9,"type":0,"instruction":"Turn left","name":"-","way_points":[56,71]},{"distance":0.255,"duration":51.0,"type":0,"instruction":"Turn left","name":"-","way_points":[71,76]},{"distance":0.02,"duration":4.1,"type":12,"instruction":"Keep left","name":"-","way_points":[76,77]},{"distance":2.187,"duration":437.4,"type":12,"instruction":"Keep left","name":"-","way_points":[77,106]},{"distance":0.139,"duration":27.8,"type":12,"instruction":"Keep left","name":"-","way_points":[106,109]},{"distance":0.0,"duration":0.0,"type":10,"instruction":"Arrive at your destination, on the right","name":"-","way_points":[109,109]}],"ascent":26.545997619628906,"descent":30.045997619628906}],"extras":{"surface":{"values":[[0,9,3],[9,10,14],[10,20,3],[20,35,2],[35,41,0],[41,56,2],[56,71,3],[71,85,2],[85,108,3],[108,109,4]],"summary":[{"value":3.0,"distance":0.003,"amount":61.4},{"value":2.0,"distance":0.002,"amount":31.57},{"value":0.0,"distance":0.0,"amount":5.6},{"value":4.0,"distance":0.0,"amount":1.25},{"value":14.0,"distance":0.0,"amount":0.18}]},"waytypes":{"values":[[0,10,4],[10,20,2],[20,35,4],[35,41,6],[41,56,4],[56,59,3],[59,109,4]],"summary":[{"value":4.0,"distance":0.005,"amount":84.81},{"value":2.0,"distance":0.0,"amount":8.14},{"value":6.0,"distance":0.0,"amount":5.6},{"value":3.0,"distance":0.0,"amount":1.46}]},"steepness":{"values":[[0,109,0]],"summary":[{"value":0.0,"distance":0.005,"amount":100.0}]}},"summary":{"distance":5.456,"duration":1092.8},"way_points":[0,109]},"geometry":{"coordinates":[[6.967689,50.985157,44.0],[6.967659,50.985148,44.0],[6.967563,50.985135,44.0],[6.967422,50.985158,44.0],[6.967355,50.985192,44.0],[6.967308,50.985239,44.0],[6.967202,50.985353,42.0],[6.966811,50.985826,42.0],[6.966764,50.985868,42.0],[6.966683,50.985869,42.0],[6.966556,50.985827,42.0],[6.96676,50.985535,42.0],[6.967298,50.984602,43.4],[6.967604,50.983956,44.0],[6.967894,50.983354,44.7],[6.968024,50.983136,46.0],[6.968102,50.983007,46.0],[6.968355,50.982525,46.0],[6.968375,50.982446,46.0],[6.968338,50.982298,46.0],[6.968032,50.982109,46.0],[6.968094,50.98206,46.0],[6.968183,50.981985,46.0],[6.968249,50.981969,46.0],[6.968439,50.981939,46.0],[6.968323,50.981581,46.0],[6.968364,50.981467,46.0],[6.968487,50.981372,46.0],[6.968708,50.981232,45.0],[6.969248,50.980793,45.1],[6.970085,50.980188,45.1],[6.970332,50.979907,45.3],[6.970691,50.979543,45.3],[6.971784,50.978297,47.0],[6.972365,50.977671,47.0],[6.972645,50.977447,47.0],[6.9731,50.976898,46.0],[6.973463,50.976346,46.0],[6.974238,50.97528,46.0],[6.974277,50.975224,46.0],[6.974354,50.975139,46.0],[6.974495,50.974963,46.0],[6.974601,50.97483,47.1],[6.97504,50.974156,47.5],[6.975662,50.973338,48.0],[6.975784,50.973263,48.0],[6.976176,50.972747,48.0],[6.97624,50.972653,48.0],[6.976495,50.972251,48.0],[6.976575,50.972164,48.0],[6.976974,50.971762,47.0],[6.977203,50.971469,47.0],[6.9775,50.971073,47.0],[6.977567,50.971018,47.0],[6.977664,50.970881,47.0],[6.978022,50.970346,47.6],[6.978436,50.969796,48.0],[6.978581,50.969845,48.0],[6.979031,50.969991,46.7],[6.979493,50.969959,46.0],[6.979795,50.96994,46.0],[6.980022,50.969987,46.0],[6.980906,50.969974,46.0],[6.983832,50.969774,46.4],[6.984756,50.96967,47.0],[6.985674,50.969586,47.5],[6.986396,50.969668,47.4],[6.986954,50.9697,47.5],[6.987445,50.969643,47.4],[6.987676,50.969639,47.2],[6.988146,50.969673,46.0],[6.988405,50.9697,46.0],[6.988357,50.970266,46.0],[6.988379,50.970338,46.0],[6.988544,50.970519,46.0],[6.988808,50.97065,46.0],[6.99042,50.97135,45.0],[6.99066,50.971454,45.0],[6.990962,50.971613,46.4],[6.991147,50.971735,46.6],[6.991309,50.971872,46.9],[6.991454,50.972024,47.1],[6.991585,50.972217,47.4],[6.991676,50.97242,50.0],[6.991722,50.972684,50.3],[6.991784,50.972826,51.0],[6.991535,50.973525,51.0],[6.991092,50.974409,48.8],[6.990416,50.975411,48.3],[6.989521,50.976361,49.0],[6.989314,50.976573,47.4],[6.988377,50.977307,46.3],[6.98723,50.978058,44.2],[6.986085,50.978726,43.5],[6.984912,50.979315,42.5],[6.983702,50.979779,42.0],[6.981832,50.980375,42.0],[6.9806,50.980776,44.0],[6.980073,50.980948,44.0],[6.979466,50.981146,40.0],[6.976819,50.982037,42.0],[6.975487,50.982531,42.0],[6.974329,50.983002,46.0],[6.973112,50.983547,44.2],[6.972037,50.984102,43.7],[6.971468,50.984425,45.0],[6.971304,50.984541,45.0],[6.971066,50.984712,45.0],[6.970614,50.985004,43.0],[6.969934,50.985444,40.5]],"type":"LineString"}}],"metadata":{"attribution":"openrouteservice.org | OpenStreetMap contributors","service":"routing","timestamp":1717673089172,"query":{"coordinates":[[6.967670917510987,50.98518039417317],[6.969945430755616,50.985450554654086]],"profile":"cycling-regular","preference":"recommended","format":"geojson","units":"km","language":"en","instructions_format":"html","elevation":true,"extra_info":["surface","steepness","waytype"]},"engine":{"version":"8.0.1","build_date":"2024-05-14T10:47:52Z","graph_date":"2024-05-29T07:51:39Z"}}} ```

Current behavior

even with tag bike:designated the way with highway:construction is not usable as it is excluded when checking against ways with speeds: https://giscience.github.io/openrouteservice/technical-details/tag-filtering#cycling-regular-cycling-electric-cycling-road-cycling-mountain (or see CommonBikeFlagEncoder)

Expected behavior

when a way is tagged as bicycle:yes (or also with designated,permissive, official, but osm wiki only talks about yes https://wiki.openstreetmap.org/wiki/Tag:highway%3Dconstruction) cycling profiles should be able to route over it

Openrouteservice Version

8.0.1

Build date

2024-05-14T10:47:52Z

Graph date

2024-05-29T07:51:39Z

Forum Topic Link

No response

aoles commented 4 weeks ago

The issue is not only limited to ways tagged as highway=construction. It is valid also for ways with implicit access restrictions such as motorways, as according to OSM wiki

In some places areas some highway=motorway allow cyclists and pedestrians (on a shoulder). It means that explicit foot=no, bicycle=no, shoulder=yes may be useful even if seemingly obvious[1].

Therefore, explicit access tags should take precedence over implicit access based on highway type.