itinero / routing2 Goto Github PK
View Code? Open in Web Editor NEWThe next version of the Itinero route planner.
License: Apache License 2.0
The next version of the Itinero route planner.
License: Apache License 2.0
Some obstacles (e.g. street lights) can have a (profile specific) cost. This should be added to the time calculation.
Ping @pietervdvn when this is exposed in the lua profiles.
E.g. Blankenbergse Steenweg - Oostendse steenweg rotonde
Itinero already depends on System.Text.Json, remove the Newtonsoft dependency.
Let's go for full turn-weight support. We model turning weights on vertices using a turn-weights table. This idea is loosely is based on this research paper and it seems the CRP paper more or less contains this approach too.
We maintain a single table per vertex and the edges around that vertex are the indexes in that table. We model this as follows:
Similar to edge types we maintain one index of highly common turning weight tables we can point to. The edge indexes are rewritten to maximize reuse of common turning weight tables. This means we have two types of turn weight tables:
global
: Commonly reused, global turn weight tables.local
: Unique local versions at tile level.The turn weight tables can also different per used profile. We given them a string ID describing what they are for, for example 'bicycle', 'car'. These can then be reused for multiple profiles. The commonly used turning weight tables are shared.
There are three main types of restrictions:
local
.TBD
How is this handled from a profile perspective, what do we ask the profile and what do we store in the routing graph? The turn weight tables are the edge type equivalent, they can only be built after the routing graph has been interpreted by the profile(s).
Ideas:
Implement turn-restriction support on a per-tile base. What needs to be done:
E.g.: 'parking:lane:left=no_stopping; parking:lane:right=yes' will have different results
For performance reasons we need to precalculate profile metrics. A profile is a function:
We need to store this inline to remove the need to load attributes sets for each edge and translate them to factors and speeds again and again. We should also consider storing aspects to enable highly flexible profiles based on a set of precalculated fixed edge properties or 'aspects'.
A solution could be:
The aspect key value pairs are stored where appropriate.
Hi:
I am using the Class PBFOsmStreamTarget of the OsmSharp API.
This class has methods for adding nodes and ways in the PBF file, but I cannot find the methods to delete them.
How can I delete a way or a node in the PBF file?
Any idea?
Thanks for advance!
Implement elevation support similar to what was done in Itinero1.
Observed behaviour: when doing oneway routing, the tile boundary clips and reverts one of the ways, resulting in two oneway segments pointing to each other, resulting in a way that can never be taken:
The screenshot above is located here: https://www.openstreetmap.org/search?query=Bertem#map=18/50.86156/4.62973
There are some improvements possible in graph tile storage. We make the distinctions between:
Routing data: data that is used during route planning:
Meta data: data is not used during route planning but is needed for a good output and for preprocessing:
The focus should be on getting storing the routing data as efficiently as possible. The meta data has to be accessible but doesn't not have to be available immediately when accessing an edge.
The vertices have the following data:
The current graph edges has the following data:
Ideal would be to have a data structure where we have vertexids and edgeids that increase by one each time a vertex or edges is added. These IDs remain constant even when changing some of the edge payloads.
Routing data
One byte array with vertex routing data:
One edge array with edge routing data:
Meta data
Now that we have one-increasing ids that won't change we can store all meta-data using those ids. We store the edge attributes identified by edge id, the same for the shapes, turn restrictions and vertex attributes.
When the lua-profile returns '120' as 'forward_priority', it becomes zero in the debug output.
I did put in a 'debug'-statement for a testcase.
When the profile is called with
highway = motorway
oneway = both
_direction = against
access = yes
speed = 120
the resulting object is:
forward_speed = 120
backward_speed = 120
forward = 0.008333333333333333
backward = 0.008333333333333333
canstop = true
Other tags and their results in this document
However, the route mysteriously fails. When trying a very synthetic testcase, it won't take the motorway but will make the detour for car.fast
:
(The motorway is the straight line, the detour are residentials)
When dumping the routerdb to geojson, the following data is obtained.
testcase-motorway.osmcar.fast.geojson.txt
Note that _forward:factor is 0 for the motorway, but not for the residential area
To avoid too much overhead and to make things clear for users of Itinero1 we need to:
Hi,
I have seen that this functionality to deal with no-go and speed zones is already implemented. I have just seen in Itinero roadmap.
What code would I have to include to define a no-go polygon, to include it in the profile and finally to be able to treat it in a routerdb file?
The goal is to get a valid route between an origin and destination on the map with the "Calculate (profile, start, end)" method and to take into account no-go and speed areas. The no-go zones are forbidden and the method "Calculate" must know it to return a right route.
I would be very grateful if you could help me.
Kind regards.
Luz María.
An example use case for this is to generate instructions such as:
In the following case, a crash happens:
var routerDb = new RouterDb...
routerDb.prepareFor(profile1)
routerDb.prepareFor(profile2)
routerDb.useOsmStream(...)
routerDb.WriteTo(file)
routerDb = RouterDb.ReadFrom(file)
routerDb.prepareFor(profile1)
routerDb.prepareFor(profile2)
routerDb.Snap( ... ) // crashes
I spent quite some hours figuring this out. I assumed that 'prepareFor' would be idempotent; but it clearly isn't. Maybe an error could be thrown in case of this misuse?
The idea is to take an OSM-stream and amend it with more data, e.g. relations, elevation, ... by generating more tags from external datasets.
This stream can then become a routerdb or a new .osm-file (aka fun preprocessing for others)
At last, this should be easily configurable with a configfile.
See also #4
We need to be able to handle route relations and networks:
Other case this could apply to:
These are usually not modeled as part of the edge attributes and have the following issues:
Copying the attributes:
This could be done using a namespace prefix set1_(key)=(value)
for example. This is problematic because these semantics will have to be taken over and used everywhere:
set
prefix.We add another layer on top of the current attributes and edge has in the form of 'edge sets'. These sets could be used to express general properties about edges that are generally not part of the their attributes. This includes but is not limited to: cycling|foot|transit networks, low emissions zones, country ids
I had a testcase where the target point lies close to a road non-accessible to the profile under testing. Ideally, it would be possible to snap to the closest routable road. However, this testcase would snap to the non-routable road, causing the test to fail.
To progress:
The new test case of the routing profiles fails with this input and bicycle.short
It is mentioned in Itinero.IO.Osm.Tiles.csproj
I'mma remove it in my branch, but for others to build it, it would be cool if a default version is added, or at least some indication on how to download it is present somewhere.
This is especially important for ferries, but also for aerialways.
While debugging the test bench, I got this case:
The new route planner follows the pedestrian area:
The area is tagged with area=yes
.
So far so good - in order to fix the test, I attempted to add an access restriction so that ways with area=yes
can not be accessed anymore (in most cases, they give truly weird routeplanning). However, when debugging, the area
-tag is not passed to the profile, but it seems to disappear mysteriously.
In a route object, TotalDistance and TotalTime should be multiplied by 100 to get the distance in meters and seconds respectively. This is done by the routebuilder
I know this is done to have more precision, but is that really needed? Having it in meters and seconds is more intuitive and makes using the library easier.
We need to figure out how to manage the data in the graph. Specifically with the following cases in mind:
At minimum we need the following features:
Open questions:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.