Tag Info

Hot answers tagged

3

I had the same problem few weeks ago and solved it by manually drawing lines from nearest node. I don't know if it's one and only resolution, it's quite hard and tricky but its working quite good. Firstly I'm selecting start edge, stop edge and result (path from routing) into record variables, then doing some post-procesing: Cut the result road if it's ...


2

If you have the points, then it's as simple as SELECT ST_DistanceSpheroid(pt1, pt2); Or alternately SELECT ST_Distance(pt1::geography, pt2::geography);


1

The start and end parameter are node ID's. If you have the vertices table, then you can use the following query to find the nearest node to your point coordinates. SELECT * FROM vertices ORDER BY the_geom <-> ST_GeometryFromText('POINT(lon lat)',4326) LIMIT 1; If you don't have the vertices table, then you can (re)create it with the ...


1

Hey first you should try to dump your database using pg_dump (http://www.postgresql.org/docs/9.3/static/app-pgdump.html) before you do anything else. This at least should give you a copy of the current non working data, which you can revert back to. Also make a copy of your data dir ...


1

This function code could be (it's an example - did not check if it's working) : CREATE OR REPLACE FUNCTION give_me_cost(source integer, target integer) RETURNS decimal(8,2) AS $BODY$ with subset as ( SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra( 'SELECT gid as id, source, target, st_length(geom) as cost FROM roadnetwork', $1, $2, ...


1

I've answered similar question here. I think this could be what you're looking for.


1

Firstly few questions: 1. what do you mean by converting roads to nodes? Maybe you meant network graph? 2. Are you able to find at least one way and the trouble is with many ways? 3. Nearest school euclidean or by the roads? 4. What was the work-flow of this conversion form roads to nodes? 5. What are the names of tables and column names in this tables? 6. ...


1

Putting extra nodes to the static graph is no good idea. One reason is that the graph may be shared by parallel routing request. Another is that the graph will grow with each request. One solution is to overlay the graph with virtual edges and nodes and to write a router which is able to distiguish between them. This is the technique used by osm2po. ...



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