Closed jbelien closed 6 years ago
Check the IDP tool. By default you have two kinds of files available on files.itinero.tech:
(country).c.cf.routerdb
: Means, contains network for cars, plus contracted with car-fastest.(country).a.routerdb
: Means, contains network for all default vehicles, no contracted graphs.Basically this means that when loading the second one it can handle any profile but it's advised to contract the graph for the profiles you are going to use. To add a contracted graph for cars for example:
./IDP --read-routerdb belgium.a.routerdb --contract car --write-router
db belgium.a.cf.routerdb
Okay, that part I get :)
But how can I query pedestrian
through the API ?
I have to run something like this first ?
./IDP --read-routerdb belgium.a.routerdb --contract pedestrian --write-router
db belgium.a.pf.routerdb
Yeah, so the request fails one belgium.c.cf.routerdb because the pedestrian data isn't in there. It only has the roads for cars, it drops everything else. You need a different routerdb.
You should be able to replace 'car' in the request with 'pedestrian' and it should work when the belgium.a.routerdb is loaded.
The only difference between contracted and uncontracted should be speed, so it should work with belgium.a.routerdb out-of-the-box. Unless you ran into another bug ;-)
The first thing I did was to try with belgium.a.routerdb
but even the car
routing didn't work with that one.
I had to load belgium.c.cf.routerdb
to make the API work.
Nevermind, I just tried again and it works with belgium.a.routerdb
and pedestrian
profile.
It's slower indeed, but now I know how to contract it 👍
Hey,
I tried to generate a new .routerdb
file for pedestrians with
./IDP --read-pbf belgium-latest.osm.pbf --pr --create-routerdb vehicles=pedestrian --contract pedestrian --write-routerdb belgium.p.pf.routerdb
I loaded your belgium.c.cf.routerdb
and my belgium.p.pf.routerdb
in to data
directory.
My expectation was that both car
and pedestrian
profiles will be loaded.
But profile car
is not found : Profile with name 'car' not found.
.
So I guess, I understood wrong and I need to have both profiles in one single file, right ?
Yes both in one file or you can rename one to belgium-pedestrian...
The name of the file until the first '.' is used as instance name so in your case one will override the other.
Okay, makes perfect sense !
For performance, do you think it's better to have one instance per transportation (belgium-car
, belgium-pedestrian
, ...) or one single instance (belgium
) including every transportation contracted ?
Performance should be similar, you may see a small increase in calculation time when using a mixed router db:
So in most cases it makes more sense to mix them. It is possible that two seperate instances can handle more requests between them but I haven't tested that.
Thanks :)
The API works fine with
belgium.c.cf.routerdb
andcar
profile but how can I change profile ?I loaded
belgium.a.routerdb
file but when I tryprofile=pedestrian
I have"Profile with name 'pedestrian' not found."
error.How can I define which profile I want ? How can I use the
belgium.a.routerdb
file (wherea
is forall
I guess) ? Is it possible to have a list of loaded profiles ?Thanks.