Hot answers tagged

2

Do you have a geometry column in your table ? if so you can join it to the result of the pgr_tsp. If the geometry you are using is linestring then you can join on the lines having source and destination shown on the result of pgr_tsp else if your geometry is point ( vertices) then you can join by ID and create your own linestring. if you don't have any ...


1

SELECT * FROM pgr_floydwarshall( 'SELECT gid AS id, source, target, meters AS cost FROM jalan') WHERE start_vid = 9 AND end_vid = 24; You were actually computing the shortest path from/to every node you have which was surely taking too much time, you need to add the where clause to you query so you can specify the origin and destination


1

First, to filter your result, simply add your required condition to your query. So here, it's your query with the addition WHERE start_vid = 9 AND end_vid = 24. Here you can find further info on the usage of WHERE clauses. After that, just insert your result into your desired table as explained in the documentation.


1

For osm2pgrouting V2.1: length is length of the segment in degree units cost and reverse_cost is the length in degree units. (include the negative values for wrong way) length_m is in meters (there is no cost_m or reverse_cost_m) cost_s and reverse_cost_s is in time: seconds units (using the maxspeed value that is in km/hr transforming it to meters/second ...



Only top voted, non community-wiki answers of a minimum length are eligible