1

I think there is a bug in pgrouting 2.3 and would like fix it by changing my local stored procedure rather than waiting for the official release. I edited my local nodeNetwork.sql file, updated the extension, but did not see the changes; I also tried to drop and recreate pgrouting extension to no avail. What is the correct way to update and reload a PostgreSql extension?


As for the bug itself, I the following section in nodeNetwork.sql seems wrong:

--HAD TO CHANGE THIS QUERY
-- p_ret= 'create temp table inter_loc on commit drop as ( 
--        select l1id, l2id, ' || vst_line_locate_point || '(line,point) as locus from (
--        select DISTINCT l1id, l2id, line, (ST_DumpPoints(geom)).geom as point from intergeom) as foo
--        where ' || vst_line_locate_point || '(line,point)<>0 and ' || vst_line_locate_point || '(line,point)<>1)';
    p_ret= 'create temp table inter_loc on commit drop as ( select * from (
        (select l1id, l2id, ' || vst_line_locate_point || '(line,source) as locus from intergeom)
         union
        (select l1id, l2id, ' || vst_line_locate_point || '(line,target) as locus from intergeom)) as foo
        where locus<>0 and locus<>1)';

I believe the commented out part is correct, which was in the earlier release. The old code uses intersection point (geom) to cut lines, whereas the new code uses end points (source and target) of a line to cut anther line at intersection, which makes no sense. As the result, I see pgr_nodeNetwork() often creates 4 nodes for an intersection but not the intersection point, so no routes can be created between the 2 lines.

1

In case of pgRouting ALTER EXTENSION extension_name UPDATE [ TO new_version ] is not implemented.

However, you can just drop the extension and create it again.

  • Dropping and recreating extension works. Thanks for the answer! – Huanchun Ye Oct 12 '16 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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