Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Doev opened this issue Jul 7, 2020 · 7 comments
Open

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

Doev opened this issue Jul 7, 2020 · 7 comments

Comments

@Doev
Copy link

Doev commented Jul 7, 2020

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
Copy link

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
Copy link
Author

Doev commented Oct 8, 2020

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
Copy link
Member

dkastl commented Oct 8, 2020

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
Copy link

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
Copy link

Hai Doev

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

@dkastl
Copy link
Member

dkastl commented Oct 9, 2020

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants