osm2pgrouting icon indicating copy to clipboard operation
osm2pgrouting copied to clipboard

mapconfig_for_cars.xml -> "unclassified" has wrong priority

Open Doev opened this issue 5 years ago • 7 comments

Hi,

in the sample file "mapconfig_for_cars.xml" the "unclassified" way has a priority of 3, but I think this kind of road is more important than "residential" ways (priority 2.5).

When I read the config correct, a lower priority results in less costs, not?

Doev avatar Jul 07 '20 13:07 Doev

Hi Doev

can I ask, what does this priority scale mean? is priority 1 higher in value? I really don't know and I'm still figuring out what this priority scale means.

bawidyantoro avatar Oct 08 '20 08:10 bawidyantoro

Hello bawidyantoro,

I have to guess, cause I am only a user. But for sure it means the priority for the routing algorithm to use a given road type.

Doev avatar Oct 08 '20 10:10 Doev

Answer to the first question: anyone is free to adjust their configuration file as they like. The one(s) in the repository are just examples. If someone has a better setup and things it should be changed in the repository, a pull request is appreciated.

Answer to the second question: after import there are a few tables created with classifications and sample costs. But in the end pgRouting does not enforce the use of priorities or specific costs. When you write your SQL query using a pgRouting function you specify what you want to use as a cost, and using priorities is a way to increase or lower costs.

dkastl avatar Oct 08 '20 15:10 dkastl

Hai dkastl

Thank for your reply. Does this mean that the priority value is optional and can be modified as needed? if true means that the user can adjust according to their needs. The problem is I am confused, why are the values different like 1.0, 1.15, 1.30, 1.75, then increased to 2.5, 3.0, and 5. I am curious about the initial calculations so that this becomes the default configuration. Thank you.

bawidyantoro avatar Oct 09 '20 13:10 bawidyantoro

Hai Doev

I thought so. but why the margin value can be different as I wrote above.

bawidyantoro avatar Oct 09 '20 13:10 bawidyantoro

In pgRouting it's all up to the user how to define your "cost function". So even if you have those values after import you could just go with the length of the road segments as costs, which would give you the shortest path.

I do not really know historically how the attributes and their values were introduced. You may want to look at the workshop, which also uses osm2pgrouting to import the data. But the examples later just use simple attributes: https://workshop.pgrouting.org/2.6/en/index.html

dkastl avatar Oct 09 '20 13:10 dkastl

Thank you for your sharing, Mr. dkastl. I want to learn it more and more.

bawidyantoro avatar Oct 10 '20 09:10 bawidyantoro