Giter Club home page Giter Club logo

Comments (6)

cayetanobv avatar cayetanobv commented on August 23, 2024

This issue was discussed a long time ago here: #8

from osm2pgrouting.

Langlaeufer avatar Langlaeufer commented on August 23, 2024

yes, the last post was my point. length in degree calculate on a Plate Carree
I was asking me if the distance in degree is needed for A*-Funktion to approximate air line, because also start and end node are given in degree.
length in meter is already stored in the table, it only needs to add also cost, reverse cost in meter.

from osm2pgrouting.

cvvergara avatar cvvergara commented on August 23, 2024

Once data is loaded into the database you can use postGIS to calculate haversine distance for exampĺe

from osm2pgrouting.

Langlaeufer avatar Langlaeufer commented on August 23, 2024

yes, in postgis I can calculate all lengths, times, coordinate-values. So the question is, why are some columns present and others often needed not. I would assume the normally metric length (distance on the spheroid) and the resulting time is used as cost function for routing algorithms.
Because of the missing documentation I have to guess:
I guess the distance in degree is a hack to let the A* function work with geographic coordinates. I can't find any other reason for using the distorted Plate Carree degree length instead of correct spheroid length. Even spherical length would be better.

from osm2pgrouting.

dkastl avatar dkastl commented on August 23, 2024

What about dropping all length computation, that osm2pgrouting does, and leave it up to the user to decide what they want? It should be rather simple to do this with a bit of PostGIS as mentioned before.

This means less documentation and no confusion ;-)

I actually always had the impression, that there was some length taken from OSM data, but I must admit that I never checked if it's really the case.

from osm2pgrouting.

Langlaeufer avatar Langlaeufer commented on August 23, 2024

To remove everything specific which can be easily calculated from the database would make it much more generic and easier to understand.

The basic values in table ways are: gid, osm_id, tag_id, name, source, target, one_way, maxspeed_forward, maxspeed_backward, geom. All other values can be added via SQL.

These values would be helpful to start with dijkstra (but can be calculated via SQL)
lenght_m - from ST_length(geom,true)
cost_m - from length and oneway
reverse_cost_m - from length and oneway

maxspeed and time are only working for car navigation:
cost_s - from const_m and speed
reverse_cost_s - from reverse_const_m and speed

This is for using original OSM ids
osm_source, - lookup in ways_vertices
osm_target - lookup in ways_vertices

I guess this is for A* (when using with geographic coordinates)
x1,x2,y1.y2 - ST_X, ST_Y, ST_StartPoint, ST_EndPoint
length and cost (in degree) -- ST_length(::geomerty) and Oneway

In all case a small tutorial how to calculate distance, time and also how to consider access and roadtype would be great.
And of course a documentation that describes what the program is really doing.

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.