Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a road network where I do a driving distance operation through pgrouting. This is my SQL:

SELECT * FROM driving_distance('SELECT gid AS id,source,target, cost FROM elveg',676663,1000,false,false);

From this query I get a strange result: http://bildr.no/view/1373984

Black is my road network and green is the result from the above query. From the image you see that some edges are not included(not green) while edges which can only be connected through this not included edge in fact is included?

How can this be? Am I doing something totally wrong here?

share|improve this question

1 Answer

You have created routing table with too big tolerances.

When you have linestring table and you create edge/vertex table for routing algorithm, you need to give tolerance. For example



        |  a-line
  ------o-------
c-line /
        |  -b-line
        |

In example both a and b line should intersect at "o" but something went wrong somewhere. So easy "fix" is use that "1m" tolerance, but it his example it would probably "eat" c-line away because its lenght is "1m"

third edit: now that i picture again, it just looks like you routing edge/vertex table is broken, try regerate it using sane tolarenace see for howto "http://pgrouting.org/docs/howto/topology.html#pgrouting"

This one seems to be good example howto do it http://pgrouting.org/docs/foss4g2008/index.html

share|improve this answer
Hi, could you add more details? – R.K. Jan 27 at 6:28
What do you mean simplexio? I use this table for regular shortest path routing and it works fine for that? – Espen Jan 27 at 20:51
It's been a while i last time used pgrouting, but i think it need its own table . i mean "assign_vertex_id('<table>', float tolerance, '<geometry column', '<gid>')" functio which creates network topology from table – simplexio Jan 28 at 8:16
At the moment assign_vertex_id gives an error. So something is not working right here :-) ERROR: query string argument of EXECUTE is null CONTEXT: PL/pgSQL function assign_vertex_id(character varying,double precision,character varying,character varying) line 36 at EXECUTE statement – Espen Jan 30 at 12:43
CREATE OR REPLACE FUNCTION assign_vertex_id(schema_name varchar, geom_table varchar, tolerance double precision, geo_cname varchar, gid_cname varchar) Is in latest version , so you need add schema there – simplexio Jan 30 at 12:55
show 2 more comments

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything will be deleted. See Good Subjective, Bad Subjective for more information.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.