Giter Club home page Giter Club logo

Comments (5)

dkastl avatar dkastl commented on July 21, 2024

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

from osm2pgrouting.

dkastl avatar dkastl commented on July 21, 2024

I agree that a bit more documentation might be good to have.
However, the formula is available in this SQL:

" UPDATE " + table +
" SET length_m = ST_length(geography(ST_Transform(the_geom, 4326))),"
" cost_s = CASE "
" WHEN one_way = -1 THEN -ST_length(geography(ST_Transform(the_geom, 4326))) / (maxspeed_forward::float * 5.0 / 18.0)"
" ELSE ST_length(geography(ST_Transform(the_geom, 4326))) / (maxspeed_backward::float * 5.0 / 18.0)"
" END, "
" reverse_cost_s = CASE "
" WHEN one_way = 1 THEN -ST_length(geography(ST_Transform(the_geom, 4326))) / (maxspeed_backward::float * 5.0 / 18.0)"
" ELSE ST_length(geography(ST_Transform(the_geom, 4326))) / (maxspeed_backward::float * 5.0 / 18.0)"
" END "
" WHERE length_m IS NULL AND maxspeed_backward !=0 AND maxspeed_forward != 0;");

Maybe it would be better to leave the cost computation to the user, as also discussed recently here: #275 (comment)

from osm2pgrouting.

Doev avatar Doev commented on July 21, 2024

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.

from osm2pgrouting.

bawidyantoro avatar bawidyantoro commented on July 21, 2024

Dear dkastl

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

from osm2pgrouting.

Doev avatar Doev commented on July 21, 2024

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

from osm2pgrouting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.