osm2pgrouting icon indicating copy to clipboard operation
osm2pgrouting copied to clipboard

How is the column "cost" and similars calculated?

Open Doev opened this issue 5 years ago • 5 comments

Hello,

first: I do not feel well with starting this question as an issue. Is there any forum, that I can use for asking common questions?

How are the columns "cost" and "cost_s" calculated? I don't see any hint in the "mapconfig.xml".

Doev avatar Jul 07 '20 12:07 Doev

The following "channels" are available to ask questions: http://pgrouting.org/support.html The Gitter channel is in general a good place: https://gitter.im/pgRouting/pgrouting

dkastl avatar Jul 07 '20 15:07 dkastl

I agree that a bit more documentation might be good to have. However, the formula is available in this SQL: https://github.com/pgRouting/osm2pgrouting/blob/2adbbf361af7cbd45b8821a498ed586bd64bbf65/src/database/Export2DB.cpp#L370-L380

Maybe it would be better to leave the cost computation to the user, as also discussed recently here: https://github.com/pgRouting/osm2pgrouting/issues/275#issuecomment-652447496

dkastl avatar Jul 07 '20 15:07 dkastl

Good morning Daniel,

thank you for your info. I didn't see that osm2pgrouting is an official pgrouting project and the theire channels can be used. Next time I will use it.

Doev avatar Jul 08 '20 07:07 Doev

Dear dkastl

what the meaning og (maxspeed_backward::float * 5.0 / 18.0)? can I modify it as neede in osm2pgrouting?

bawidyantoro avatar Oct 13 '20 06:10 bawidyantoro

bawidyantoro, it's just sql-code. You can execute it later in your database. But you have to modify the WHERE part, cause it only updates the fields that contains NULL.

In your case, I would take a look to the file that Daniel pointed to: osm2pgrouting/src/database/Export2DB.cpp

Doev avatar Oct 13 '20 09:10 Doev