pgRouting / osm2pgrouting

Import tool for OpenStreetMap data to pgRouting database
https://pgrouting.org
GNU General Public License v2.0
286 stars 113 forks source link

mapconfig_for_cars.xml -> "unclassified" has wrong priority #282

Open Doev opened 4 years ago

Doev commented 4 years ago

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?

bawidyantoro commented 3 years ago

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.

Doev commented 3 years ago

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.

dkastl commented 3 years ago

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.

bawidyantoro commented 3 years ago

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 commented 3 years ago

Hai Doev

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

dkastl commented 3 years ago

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

bawidyantoro commented 3 years ago

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