Commit Graph

1290 Commits

Author SHA1 Message Date
zephyr
ebd9ab4548
fix(json_render): json_render is not accurate enough for extremely sm… (#6531) 2023-02-02 18:58:25 +01:00
Michael Bell
9ad432c5b2
Fix adding traffic signal penalties during compression (#6419)
Weight and duration penalties are flipped in the lambda function
that applies penalties from traffic signals.

Duration is in deciseconds, whilst weight is multipled by
10^weight_precision, with weight_precision being 1 by default.

Therefore, for default routability profile, the penalties end up
being the same, hence why no tests picked this up.

If distance weight is used however, it will incorrectly apply an
additional penalty to the weight, and not add the traffic signal
delay to the duration in the routing graph.

To confuse things further, in some API responses the values are
correct because they use geometry data instead, but it's still
possible that a sub-optimal route was selected.

However, given the distance weight is in meters, and the additional
penalty per traffic light would be 20, it's unlikely this would
have changed the routing results.

In any case, we correct the function to apply the arguments correctly.
2022-10-23 14:59:12 +01:00
Siarhei Fedartsou
9d160a9b5d
Revert back to using custom HTTP parser instead of Boost.Beast (#6407) 2022-10-14 14:37:33 +02:00
Siarhei Fedartsou
d143de597d
Fix bug with large HTTP requests leading to Bad Request in osrm-routed. (#6403) 2022-10-13 16:53:49 +02:00
Siarhei Fedartsou
4026ed54c0
Add support for surface=metal,grass_paver,woodchips in bicyle profile (#6395) 2022-10-11 11:09:56 +02:00
Daniel J. H
895e4bf6d5
Adds cucumber scenario for u turn restrictions at intersection (#4484) 2022-10-10 22:27:27 +02:00
Siarhei Fedartsou
9a4b4648f4
Improve performance of JSON rendering (#6380) 2022-10-03 21:43:51 +02:00
Michael Bell
b7daa7e641
Gracefully handle no-turn intersections in guidance processing. (#6382)
Badly constructed OSM intersections can create OSRM intersection
views that have no valid turns.
The guidance code for segregated intersections tries to look
ahead to the second intersection to ensure lanes are  announced
intuitively.
Currently, OSRM assumes there are always turns at the second
intersection that we should consider. This commit corrects
this assumption so that it can now handle badly constructed
OSM intersections with no turns.
2022-10-01 14:35:08 +01:00
Michael Bell
ef8f3d7508
Ensure u-turn exists in intersection view (#6376)
Due to some rather complex logic that tries to calculate intersection
angles by looking further up the road, it's possible to return
an intersection view that is missing a u-turn - something which
is assumed to exist in later guidance calculations.

We apply a fix here by ensuring the u-turn is always included in
the returned view.
2022-09-27 13:49:12 +01:00
Louis
660cea8fcc
Bicycle surface speeds (#6212) 2022-09-23 17:54:55 +02:00
Siarhei Fedartsou
2cf957148b
Support floats for speed value in traffic updates CSV (#6327) 2022-08-30 15:34:46 +02:00
Michael Bell
b17cbb4c47
Support OSM traffic signal directions (#6153)
Currently OSRM parses traffic signal nodes without consideration
for the direction in which the signal applies. This can lead
to duplicated routing penalties, especially when a forward and backward
signal are in close proximity on a way.

This commit adds support for directed signals to the extraction and
graph creation. Signal penalties are only applied in the direction
specified by the OSM tag.

We add the assignment of traffic directions to the lua scripts,
maintaining backwards compatibility with the existing boolean
traffic states.

As part of the changes to the internal structures used for tracking
traffic signals during extraction, we stop serialising/deserialising
signals to the `.osrm` file. The traffic signals are only used by
`osrm-extract` so whilst this is a data format change, it will not
break any existing user processes.
2022-08-30 10:36:49 +01:00
Michael Bell
bfb74c2dad
Fix snapping target locations to ways used in turn restrictions (#6339)
Currently there is an edge-case in the turn restriction implementation,
such that routes can not be found if the target input location snaps
to a way used in a (multi) via restriction.

With the addition of snapping input locations to multiple ways, we
can now also snap to the "duplicate" edges created for the restriction graph,
thereby fixing the problem.
This is achieved by adding the duplicate restriction edges to the
geospatial search RTree.

This does open up the possibility of multiple paths representing exactly
the same route - one using the original edge as a source, the other
using the duplicate restriction graph edge as source. This is fine,
as both edges are represented by the same geometry, so will generate
the same result.
2022-08-27 15:59:44 +01:00
Michael Bell
d74e7b66bd
Support snapping to multiple ways at an input location (#5953)
This PR improves routing results by adding support for snapping to
multiple ways at input locations.

This means all edges at the snapped location can act as source/target
candidates for routing search, ensuring we always find the best route,
and not the one dependent on the edge selected.
2022-08-27 11:36:20 +01:00
Michael Bell
a98074a051
Improvements to maneuver override processing (#6215)
This change unblocks the osrm-extract debug build, which is
currently failing on a maneuver override assertion.

The processing of maneuver overrides currently has three issues
- It assumes the via node(s) can't be compressed (the failing assertion)
- It can't handle via-paths containing incompressible nodes
- It doesn't interop with turn restriction on the same path

Turn restrictions and maneuver overrides both use the same
from-via-to path representation.
Therefore, we can fix these issues by consolidating their
structures and reusing the path representation for
turn restrictions, which already is robust to the above
issues.

This also simplifies some of the codebase by removing maneuver
override specific path processing.

There are ~100 maneuver overrides in the OSM database, so the
impact on processing and routing will be minimal.
2022-08-24 16:19:24 +01:00
Lev Dragunov
928867c520
Add data_version field to responses of all plugins. (#5387) 2022-08-22 21:07:32 +02:00
Michael Bell
3cfd0e8334
Complete support for no_entry and no_exit turn restrictions (#5988)
The internal representation of turn restrictions expects only one
`from` way and only one `to` way.

`no_entry` and `no_exit` turn restrictions can have multiple `from` and
`to` ways respectively. This means they are not fully supported by
OSRM's restriction parser.

We complete support for these turn restriction types by parsing all
ways and converting a valid restriction with multiple `from`/`to` members
into multiple internal restrictions.
2022-08-22 12:58:16 +01:00
Michael Bell
b4b1aea567
Add support for non-round-trips with a single fixed endpoint (#6050)
Currently /trip supports finding round-trip routes where only the
start or end location is fixed. This PR extends this feature to
non-round-trip requests.

We do this by a new table manipulation that simulates non-round-trip
fixed endpoint requests as a round-trip request.
2022-08-22 12:56:47 +01:00
Siarhei Fedartsou
aadc088084
Fix distance calculation consistency. (#6315)
Consolidate great circle distance calculations to use cheap ruler library.
2022-08-19 22:31:40 +01:00
Siarhei Fedartsou
00816722dd
Configure Undefined Behaviour Sanitizer (#6290) 2022-08-01 22:40:26 +01:00
Siarhei Fedartsou
204fdaff6e
Fix bug with reading Set values from Lua scripts. (#6285)
* Fix bug with reading Set values from Lua scripts.

* Add test for foot profile named-road suffixes

Co-authored-by: Michael Bell <michael@mjjbell.com>
2022-07-30 23:14:06 +01:00
Michael Bell
37cfc7f99d
Revert "Executables use hyphens" (#6131)
This reverts commit 5bf3c7b659.
2021-09-21 13:28:01 -07:00
Michael Bell
2d1e620429
Fix test cache to consider MLD executable changes (#6129)
* Fix test cache to consider MLD executable changes

Currently the test cache is not invalidated if changes to
osrm-partition or osrm-customize executables. This is problematic
when these executables make breaking changes to the data format.

We fix this by including both in the list of executables that
can invalidate the test cache.

* Executables use hyphens
2021-09-21 12:35:34 -07:00
Michael Bell
8d3ebc64dc Add kerb barrier exception to default car profile
OSM data contains many mistakes that tag kerbs as highway barriers
when instead they are only describing highway crossings.

This PR updates the default car profile to handle these mistakes
and unblock routing on the affected highways.
2021-03-31 01:17:19 +01:00
themylogin
e7acc9df76 Fix turn.roads_on_the_left and turn.roads_on_the right for two-way roads #5128 2021-01-27 10:53:00 +01:00
Michael Bell
5266ac1635
Add support for multiple via-way restrictions (#5907)
Currently OSRM only supports turn restrictions with a single via-node or one
via-way. OSM allows for multiple via-ways to represent longer and more
complex restrictions.

This PR extends the use of duplicate nodes for representng via-way turn
restrictions to also support multi via-way restrictions. Effectively, this
increases the edge-based graph size by the number of edges in multi via-way
restrictions. However, given the low number of these restrictions it
has little effect on total graph size.

In addition, we add a new step in the extraction phase that constructs
a restriction graph to support more complex relationships between restrictions,
such as nested restrictions and overlapping restrictions.
2020-12-20 13:59:57 -08:00
Desone Burns II
b1646622e6 Changed nil test to empty test 2020-11-23 17:07:10 -07:00
Michael Bell
f87a324633
Fix crash in MLD alternative search if source or target are invalid (#5851)
In situations where there is not a valid source or target phantom
node (e.g. when snapping to an edge with a zero weight), a
heap assertion will fail in the MLD alternative search code.

We fix this by checking for empty heaps before proceeding with
the search.
2020-10-08 15:27:02 -07:00
Michael Bell
e033e0b553
Fix table result when source and destination on same one-way segment (#5828)
Fixes #5788

Table queries where source and destination are phantom nodes
on the same one-way segment can fail to find valid routes.

This is due to a bug in the MLD table generation for the
special case where the query can be simplified to a
one-to-many search.
If the destination is before the source on the one-way segment,
it will fail to find a route.

We fix this case by not marking the node as visited at the start,
so that valid paths to this node can be found later in the search.

We also remove redundant initialization for the source
node as the same actions are performed by a search step.
2020-10-07 14:58:13 -07:00
Denis Chaplygin
2d0b2ca987
Removed STXXL support. 2020-08-20 11:54:02 +03:00
Jeroen Hoek
92406da194 Bicycle: treat use_sidepath as no access
Fixes #5557.
2019-12-01 18:34:58 +01:00
Denis Chaplygin
d25a530942 Added cucumber test for skip_waypoint feature 2019-09-23 11:38:33 +03:00
Denis Chaplygin
50a1c8a08d Added flatbuffers support to Table service cucumber tests 2019-09-17 17:42:52 +03:00
Denis Chaplygin
0be87c73cf Fixed typo in flatbuffers: longitute -> longitude. 2019-08-26 14:31:51 +03:00
Denis Chaplygin
b8182dd7ff Replaced 'in' and 'out' at the flatbuffers 'instersection' object
with 'in_bearing' and 'out_bearing' to get flatbuffers schema javascript friendly.

Added a cucumber test for flatbuffers support.
2019-08-26 14:03:29 +03:00
Ilya Zverev
98294e3ddd Decrease max height to 2 meters 2019-03-04 13:23:17 +03:00
Ilya Zverev
a1e5061799 Decrease default car weight to 2 tons (#5371)
* Decrease default car weight to 2 tons
* Add a link to PR to the change log
2019-02-20 10:19:18 -08:00
Daniel Patterson
2c7c18fd24 Fix bug in snapping=any when bearings or radiuses are supplied. 2019-02-15 20:42:30 -08:00
Daniel Patterson
4f0ec785f6
Configurable snapping behaviour (#5361) 2019-02-14 17:14:50 -08:00
Lev Dragunov
8b45ff7a18
Store metadata about original OSM data, and return it in the API response, if available. 2019-01-30 15:31:56 -08:00
Daniel Patterson
381d492a8f
Add waypoints parameter to viaroute API (#5345)
* Add silent waypoints to viaroute API.
2019-01-24 16:19:59 -08:00
Daniel Patterson
1dca8ae76a Correct invalid tests - these captured the incorrect behaviour, the matrices should've been symmetrical (a->o == o->a for these cases) 2018-12-15 21:07:06 -07:00
Daniel Patterson
002e86863d Add test to ensure forward/reverse snapping distances are correct, and fix some tests that were incorrect due to the bug. 2018-12-15 21:07:06 -07:00
Huyen Chau Nguyen
77b4fbb69c Fix maxspeed to consider source:maxspeed tags (#5217)
* In Belgium the maximum speed in rural areas is 70 in the region Flanders
* parse maxspeed using source:maxspeed and maxspeed:type tags
* add changelog
* make maxspeed:advisory more important than maxspeed
* add test for source:maxspeed
2018-12-14 21:42:44 -07:00
Salim KAYABASI
717406043a Remove unused Node binary publishing, and upgrade build environment.
Upgrades the build environment to Node 10, which let's us pull down some security fixes in package dependencies that were unfixed in Node 4.

Also removes Node 4 and 6 binary publishing which were almost never used (20 downloads out of 50,000).

Fixes https://github.com/Project-OSRM/osrm-backend/issues/5312
2018-12-14 21:34:48 -07:00
Daniel Patterson
1ef85c57cc Upgrade CI environment to Node 10, remove builds for < Node 8
Remove yarn, npm is fast now, and comes with node.
Synchronize package-lock.json and package.json
2018-12-14 14:56:21 -07:00
Daniel Patterson
520b7ebbb6
Remove 5.20 build trigger from master branch - should only exist on release branches. 2018-12-14 11:53:48 -07:00
Daniel Patterson
81bc2f41a6
When matching, ignore 'is_startpoint' propert, snap to any edge (#5297)
Includes all edges in the rtree, but adds an `is_startpoint` flag to each.  Most plugin behaviour remains unchanged (non-startpoint edges aren't used as snapping candidates), but for map matching, we allow snapping to any edge.  This fixes map-matching across previously non-is_startpoint edges, like ferries, private service roads, and a few others.
2018-12-13 17:10:32 -07:00
Daniel Patterson
06e010b4d0 Include information on estimates in table response (#5259)
* Revert "Remove estimated_cells value in the response."

This reverts commit 364e35af06.

* Update changelog.

* fix linting

* adjust fallback_speed check

* change [].includes to [].indexOf !== -1 for compatibility with node 4

* change param name

* more cuke tests

* fix formatting
2018-12-11 12:21:57 -05:00
Kajari Ghosh
01ca32c81c
Fix fallback speed validity checks (#5300)
* fix fallback_speeds check to only accept values > 0

* add invalid_fallback_speed
2018-12-10 14:53:30 -05:00