I'm starting with pgrouting. After suffering a bit unable to put the data in osm postgis using osm2po with the excellent tutorial http://anitagraser.com/2011/12/15/an-osm2po-quickstart/ ran the sql generated by osm2po visualized data with http: / / localhost: 8888/Osm2poService routing is fantastic and has also insert the data in my town in postgis successfully.
Then I started reading the manual and pgrouting in http://docs.pgrouting.org/2.0/en/doc/index.html me questions arose:
1 - The data provided by osm2po are already topologically arranged just so I do consultations?
2 - The fields of my table are:
id osm_id osm_name osm_meta osm_source_id osm_target_id clazz flags source target km kmh cost reverse_cost x1 y1 x2 y2 geom_way
Can I get the total distance in miles doing a "sum" of the KM field, is this correct?
Where can I learn what each field, for example, do not know what the field clazz, cost, reverse_cost ....?
3 - The flow of my application the user is typing two addresses, I'll get the latitude and longitude of the point of origin and destination and select the launch in postgis, how do this if the source and target parameter settings are whole?
4- Does anyone have any examples of how to do this with openlayers?
I'm getting the distance of the route like this:
SELECT sum (cost) cost AS FROM pgr_dijkstra ( 'SELECT id, source, target, the cost km FROM at_2po_4pgr' 50347, 32988, false, false );
Where 50347 and 32988 are my origin and destination. I do not understand what this format is, are coordinated? The coordinates of my geocode comes in decimal degrees are respectively 51.13, -29.77 and -51.21, -30.04 if I use them so do not run the sql.
Could you explain me I can pass the coordinates for the sql?