We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
directed
When the graph is undirected, it ignores the directed flag, and has negative identifiers for the source and target
SELECT * FROM pgr_lineGraph( 'SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (2,4,5,8)', false); seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | -8 | -4 | 1 | 1 2 | -8 | 8 | 1 | 1 3 | -4 | 4 | 1 | 1 4 | -2 | 4 | 1 | -1 5 | 5 | -8 | 1 | -1 (5 rows)
Expected
seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | 2 | 4 | 1 | -1 2 | 2 | 5 | 1 | -1 3 | 4 | 8 | 1 | -1 4 | 5 | 8 | 1 | -1
CREATE TABLE edges_unique ( id BIGINT, source BIGINT, target BIGINT, cost FLOAT, geom geometry ); CREATE TABLE INSERT INTO edges_unique (id, source, target, cost, geom) VALUES (102, 1, 2, 1, ST_MakeLine(ST_POINT(0, 2), ST_POINT(2, 2))), (104, 1, 4, 1, ST_MakeLine(ST_POINT(0, 2), ST_POINT(0, 0))), (301, 3, 1, 1, ST_MakeLine(ST_POINT(2, 0), ST_POINT(0, 2))), (203, 2, 3, 1, ST_MakeLine(ST_POINT(2, 2), ST_POINT(2, 0))), (304, 3, 4, 1, ST_MakeLine(ST_POINT(2, 0), ST_POINT(0, 0))), (302, 3, 2, 1, ST_MakeLine(ST_POINT(2, 0), ST_POINT(2, 2))), (403, 4, 3, 1, ST_MakeLine(ST_POINT(0, 0), ST_POINT(2, 0))); INSERT 0 7 SELECT seq, source, target, cost, reverse_cost FROM pgr_lineGraph( 'SELECT id, source, target, cost FROM edges_unique', true); seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | 102 | 203 | 1 | -1 2 | 104 | 403 | 1 | -1 3 | 203 | 301 | 1 | -1 4 | 203 | 304 | 1 | -1 5 | 301 | 102 | 1 | -1 6 | 301 | 104 | 1 | -1 7 | 302 | 203 | 1 | 1 8 | 304 | 403 | 1 | 1 9 | 403 | 301 | 1 | -1 10 | 403 | 302 | 1 | -1 (10 rows)
expected 12 edges total
seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | 102 | 203 | 1 | -1 2 | 104 | 403 | 1 | -1 3 | 203 | 301 | 1 | -1 4 | 203 | 304 | 1 | -1 5 | 301 | 102 | 1 | -1 6 | 301 | 104 | 1 | -1 7 | 302 | 203 | 1 | 1 8 | 304 | 403 | 1 | 1 9 | 403 | 301 | 1 | -1 10 | 403 | 302 | 1 | -1 (10 rows)
The same graph as above but represented with shared identifiers on the edges
CREATE TABLE edges_shared ( id BIGINT, source BIGINT, target BIGINT, cost FLOAT, reverse_cost FLOAT, geom geometry ); CREATE TABLE INSERT INTO edges_shared (id, source, target, cost, reverse_cost, geom) VALUES (102, 1, 2, 1, -1, ST_MakeLine(ST_POINT(0, 2), ST_POINT(2, 2))), (104, 1, 4, 1, -1, ST_MakeLine(ST_POINT(0, 2), ST_POINT(0, 0))), (301, 3, 1, 1, -1, ST_MakeLine(ST_POINT(2, 0), ST_POINT(0, 2))), (203, 2, 3, 1, 1, ST_MakeLine(ST_POINT(2, 2), ST_POINT(2, 0))), (304, 3, 4, 1, 1, ST_MakeLine(ST_POINT(0, 0), ST_POINT(2, 0))); INSERT 0 5 SELECT seq, source, target, cost, reverse_cost FROM pgr_lineGraph( 'SELECT id, source, target, cost, reverse_cost FROM edges_shared', true); seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | -304 | -203 | 1 | 1 2 | -304 | 301 | 1 | -1 3 | -203 | 203 | 1 | 1 4 | 102 | 203 | 1 | -1 5 | 104 | -304 | 1 | -1 6 | 203 | 301 | 1 | -1 7 | 301 | 102 | 1 | -1 8 | 301 | 104 | 1 | -1 9 | 304 | -304 | 1 | 1 (9 rows)
Expected original ids
seq | source | target | cost | reverse_cost -----+--------+--------+------+-------------- 1 | 102 | 203 | 1 | -1 2 | 104 | 304 | 1 | -1 3 | 203 | 203 | 1 | 1 4 | 203 | 301 | 1 | -1 5 | 203 | 304 | 1 | 1 6 | 301 | 102 | 1 | -1 7 | 301 | 104 | 1 | -1 8 | 304 | 301 | 1 | -1 9 | 304 | 304 | 1 | 1 (9 rows)
The text was updated successfully, but these errors were encountered:
This has been fixed with #2625
Sorry, something went wrong.
cvvergara
No branches or pull requests
ignores the
directed
flagWhen the graph is undirected, it ignores the
directed
flag, and has negative identifiers for the source and targetExpected
Works well when the input is directed and with unique edges
expected 12 edges total
Edges with negative identifiers
The same graph as above but represented with shared identifiers on the edges
Expected original ids
The text was updated successfully, but these errors were encountered: