itinero / routing

The routing core of itinero.
Apache License 2.0
221 stars 70 forks source link

Question - Custom lua skipping to reduce filesize of routerdb #273

Open TomQv opened 5 years ago

TomQv commented 5 years ago

I want to create a Routerdb of Europe with reasonable filesize. Kind of "overland-Routing"

So I created a car-lua, which is not including highway=residential and highway=track in speed_profile-list.

Unfortunate this didn't reduce the filesize much, maybe only by 5% where I was expecting 50%, because residential and track makes more then 70% of all highways in osm.

Where am I wrong?

Ok, I could start with some osm-commandline tools, deleting this ways from the pbf, but I thought, this could also be done with a lua?

TomQv commented 5 years ago

Seems as if my test-pbf was too small (8mb) to see the effect. because of some overhead in routerdb. Using a 100mb pbf - now the difference is in deed 50%.

alecava58 commented 5 years ago

@TomQv how did you modify the lua file to avoid residential and track?

I tried to remove the speed value from the speed_profile array whiteout success.

Thanks

xivk commented 5 years ago

There is even more to be gained by removing all edges that cannot be accessed. Now they are kept in case they get trough the initial filter.

The edges can be removed right after loading but before sorting the vertices.

TomQv commented 5 years ago

How?

xivk commented 5 years ago

You would need to write a bit of custom code to check if all the profiles generate only values == 0 and remove those edges. Then compressing the database should remove the edges.

But I'm guessing that this will probably be worth just a few %...

TomQv commented 5 years ago

how did you modify the lua file to avoid residential and track?

Thats my only modification:

speed_profile = {
    ["motorway"] = 120,        
    ["motorway_link"] = 120,
    ["trunk"] = 90,            
    ["trunk_link"] = 90,
    ["primary"] = 90,          
    ["primary_link"] = 90,
    ["secondary"] = 70,         
    ["secondary_link"] = 70,
    ["tertiary"] = 70,        
    ["tertiary_link"] = 70,
    ["unclassified"] = 50,     
    -- ["residential"] = 50,       
    ["service"] = 30,
    ["services"] = 30,
    ["road"] = 30,
    -- ["track"] = 30,             
    ["living_street"] = 5,
    ["ferry"] = 5,
    ["movable"] = 5,
    ["shuttle_train"] = 10,
    ["default"] = 10
}
alecava58 commented 5 years ago

I did the same without success. Likely I did a mistake.

AC

Il mar 16 lug 2019, 22:01 Tom Flemming notifications@github.com ha scritto:

how did you modify the lua file to avoid residential and track?

Thats my only modification:

speed_profile = { ["motorway"] = 120, ["motorway_link"] = 120, ["trunk"] = 90, ["trunk_link"] = 90, ["primary"] = 90, ["primary_link"] = 90, ["secondary"] = 70, ["secondary_link"] = 70, ["tertiary"] = 70, ["tertiary_link"] = 70, ["unclassified"] = 50, -- ["residential"] = 50, ["service"] = 30, ["services"] = 30, ["road"] = 30, -- ["track"] = 30, ["living_street"] = 5, ["ferry"] = 5, ["movable"] = 5, ["shuttle_train"] = 10, ["default"] = 10 }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/itinero/routing/issues/273?email_source=notifications&email_token=AANUYQNB2CVKZW3KCTNX573P7YSH3A5CNFSM4H4LGH42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2B7EVY#issuecomment-511963735, or mute the thread https://github.com/notifications/unsubscribe-auth/AANUYQMJSZT2QHBSHPULH5DP7YSH3ANCNFSM4H4LGH4Q .