Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ Changes on the documentation to the following:

* using bootstrap_version 2 because 3+ does not do dropdowns

**pgtap tests**

* [#2559](https://github.com/pgRouting/pgrouting/issues/2559) pgtap test using sampledata

**Build fixes**

Expand Down
3 changes: 3 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ Changes on the documentation to the following:

* using bootstrap_version 2 because 3+ does not do dropdowns

.. rubric:: pgtap tests

* `#2559 <https://github.com/pgRouting/pgrouting/issues/2559>`__ pgtap test using sampledata

.. rubric:: Build fixes

Expand Down
27 changes: 1 addition & 26 deletions doc/src/sampledata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,38 +211,13 @@ will be stored on a table.
:start-after: -- p1
:end-before: -- p2

Points of interest geometry
Points of interest fillup
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Inserting the data of the points of interest:

.. literalinclude:: sampledata.queries
:start-after: -- p2
:end-before: -- p3

Points of interest fillup
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Using :doc:`pgr_findCloseEdges`
Calculating for visual purposes the points over the graph.

.. literalinclude:: sampledata.queries
:start-after: -- p3
:end-before: -- p4

A special case to arrive from both sides of the edge.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. literalinclude:: sampledata.queries
:start-after: -- p4
:end-before: -- p5

Points of interest data
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. literalinclude:: sampledata.queries
:start-after: -- p5
:end-before: -- p6

.. pois_end

Support tables
Expand Down
48 changes: 8 additions & 40 deletions docqueries/src/sampledata.result
Original file line number Diff line number Diff line change
Expand Up @@ -156,50 +156,18 @@ CREATE TABLE pointsOfInterest(
edge_id BIGINT,
side CHAR,
fraction FLOAT,
geom geometry,
newPoint geometry);
geom geometry);
CREATE TABLE
/* -- p2 */
INSERT INTO pointsOfInterest (geom) VALUES
(ST_POINT(1.8, 0.4)),
(ST_POINT(4.2, 2.4)),
(ST_POINT(2.6, 3.2)),
(ST_POINT(0.3, 1.8)),
(ST_POINT(2.9, 1.8)),
(ST_POINT(2.2, 1.7));
INSERT INTO pointsOfInterest (edge_id, side, fraction, geom) VALUES
(1, 'l' , 0.4, ST_POINT(1.8, 0.4)),
(15, 'r' , 0.4, ST_POINT(4.2, 2.4)),
(12, 'l' , 0.6, ST_POINT(2.6, 3.2)),
(6, 'r' , 0.3, ST_POINT(0.3, 1.8)),
(5, 'l' , 0.8, ST_POINT(2.9, 1.8)),
(4, 'b' , 0.7, ST_POINT(2.2, 1.7));
INSERT 0 6
/* -- p3 */
UPDATE pointsOfInterest AS p SET
edge_id = q.edge_id,
side = q.side,
fraction = q.fraction,
newPoint = ST_endPoint(q.edge)
FROM (SELECT * FROM pgr_findCloseEdges(
$$SELECT id, geom FROM edges$$,
(SELECT array_agg(geom) FROM pointsOfInterest),
0.5, partial => false)) AS q
WHERE p.geom = q.geom;
UPDATE 6
/* -- p4 */
UPDATE pointsOfInterest SET side = 'b'
WHERE pid = 6;
UPDATE 1
/* -- p5 */
SELECT pid, edge_id, side, fraction,
ST_AsText(geom), ST_AsText(newPoint)
FROM pointsOfInterest
ORDER BY pid;
pid | edge_id | side | fraction | st_astext | st_astext
-----+---------+------+--------------------+----------------+--------------
1 | 1 | l | 0.4 | POINT(1.8 0.4) | POINT(2 0.4)
2 | 15 | r | 0.3999999999999999 | POINT(4.2 2.4) | POINT(4 2.4)
3 | 12 | l | 0.6000000000000001 | POINT(2.6 3.2) | POINT(2.6 3)
4 | 6 | r | 0.3 | POINT(0.3 1.8) | POINT(0.3 2)
5 | 5 | l | 0.8 | POINT(2.9 1.8) | POINT(3 1.8)
6 | 4 | b | 0.7 | POINT(2.2 1.7) | POINT(2 1.7)
(6 rows)

/* -- p6 */
/* --POINTS CREATE end */
/* --COMBINATIONS CREATE start */
/* -- c1 */
Expand Down
22 changes: 11 additions & 11 deletions docqueries/src/withPoints-category.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ SET client_min_messages TO NOTICE;
SET
/* --q1 */
SELECT pid, edge_id, fraction, side FROM pointsOfInterest;
pid | edge_id | fraction | side
-----+---------+--------------------+------
1 | 1 | 0.4 | l
4 | 6 | 0.3 | r
3 | 12 | 0.6000000000000001 | l
2 | 15 | 0.3999999999999999 | r
5 | 5 | 0.8 | l
6 | 4 | 0.7 | b
pid | edge_id | fraction | side
-----+---------+----------+------
1 | 1 | 0.4 | l
2 | 15 | 0.4 | r
3 | 12 | 0.6 | l
4 | 6 | 0.3 | r
5 | 5 | 0.8 | l
6 | 4 | 0.7 | b
(6 rows)

/* --q2 */
Expand All @@ -25,9 +25,9 @@ FROM edges WHERE id = 15;
/* --q3 */
SELECT pid, edge_id, fraction, side
FROM pointsOfInterest WHERE pid = 2;
pid | edge_id | fraction | side
-----+---------+--------------------+------
2 | 15 | 0.3999999999999999 | r
pid | edge_id | fraction | side
-----+---------+----------+------
2 | 15 | 0.4 | r
(1 row)

/* --q4 */
Expand Down
66 changes: 33 additions & 33 deletions docqueries/trsp/trsp_withPoints.result
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ SELECT * FROM pgr_trsp_withPoints(
2 | 2 | -1 | 10 | 5 | 1 | 1 | 0.4
3 | 3 | -1 | 10 | 6 | 4 | 0.7 | 1.4
4 | 4 | -1 | 10 | -6 | 4 | 0.3 | 2.1
5 | 5 | -1 | 10 | 7 | 8 | 1 | 2.4
6 | 6 | -1 | 10 | 11 | 9 | 1 | 3.4
7 | 7 | -1 | 10 | 16 | 15 | 0.4 | 4.4
8 | 8 | -1 | 10 | -2 | 15 | 0.6 | 4.8
5 | 5 | -1 | 10 | 7 | 10 | 1 | 2.4
6 | 6 | -1 | 10 | 8 | 12 | 0.6 | 3.4
7 | 7 | -1 | 10 | -3 | 12 | 0.4 | 4
8 | 8 | -1 | 10 | 12 | 13 | 1 | 4.4
9 | 9 | -1 | 10 | 17 | 15 | 1 | 5.4
10 | 10 | -1 | 10 | 16 | 16 | 1 | 6.4
11 | 11 | -1 | 10 | 15 | 3 | 1 | 7.4
Expand Down Expand Up @@ -79,29 +79,30 @@ SELECT * FROM pgr_trsp_withPoints(
5 | 5 | -1 | -3 | -3 | -1 | 0 | 4
6 | 1 | -1 | 1 | -1 | 1 | 1.4 | 0
7 | 2 | -1 | 1 | 6 | 4 | 1 | 1.4
8 | 3 | -1 | 1 | 7 | 8 | 1 | 2.4
9 | 4 | -1 | 1 | 11 | 9 | 1 | 3.4
10 | 5 | -1 | 1 | 16 | 15 | 2 | 4.4
11 | 6 | -1 | 1 | 16 | 9 | 1 | 6.4
12 | 7 | -1 | 1 | 11 | 8 | 1 | 7.4
13 | 8 | -1 | 1 | 7 | 7 | 1 | 8.4
14 | 9 | -1 | 1 | 3 | 6 | 1 | 9.4
15 | 10 | -1 | 1 | 1 | -1 | 0 | 10.4
16 | 1 | 6 | -3 | 6 | 4 | 1 | 0
17 | 2 | 6 | -3 | 7 | 10 | 1 | 1
18 | 3 | 6 | -3 | 8 | 12 | 0.6 | 2
19 | 4 | 6 | -3 | -3 | -1 | 0 | 2.6
20 | 1 | 6 | 1 | 6 | 4 | 1 | 0
21 | 2 | 6 | 1 | 7 | 10 | 1 | 1
22 | 3 | 6 | 1 | 8 | 12 | 1 | 2
23 | 4 | 6 | 1 | 12 | 13 | 1 | 3
24 | 5 | 6 | 1 | 17 | 15 | 1 | 4
25 | 6 | 6 | 1 | 16 | 9 | 1 | 5
26 | 7 | 6 | 1 | 11 | 8 | 1 | 6
27 | 8 | 6 | 1 | 7 | 7 | 1 | 7
28 | 9 | 6 | 1 | 3 | 6 | 1 | 8
29 | 10 | 6 | 1 | 1 | -1 | 0 | 9
(29 rows)
8 | 3 | -1 | 1 | 7 | 10 | 1 | 2.4
9 | 4 | -1 | 1 | 8 | 12 | 1 | 3.4
10 | 5 | -1 | 1 | 12 | 13 | 1 | 4.4
11 | 6 | -1 | 1 | 17 | 15 | 1 | 5.4
12 | 7 | -1 | 1 | 16 | 9 | 1 | 6.4
13 | 8 | -1 | 1 | 11 | 8 | 1 | 7.4
14 | 9 | -1 | 1 | 7 | 7 | 1 | 8.4
15 | 10 | -1 | 1 | 3 | 6 | 1 | 9.4
16 | 11 | -1 | 1 | 1 | -1 | 0 | 10.4
17 | 1 | 6 | -3 | 6 | 4 | 1 | 0
18 | 2 | 6 | -3 | 7 | 10 | 1 | 1
19 | 3 | 6 | -3 | 8 | 12 | 0.6 | 2
20 | 4 | 6 | -3 | -3 | -1 | 0 | 2.6
21 | 1 | 6 | 1 | 6 | 4 | 1 | 0
22 | 2 | 6 | 1 | 7 | 10 | 1 | 1
23 | 3 | 6 | 1 | 8 | 12 | 1 | 2
24 | 4 | 6 | 1 | 12 | 13 | 1 | 3
25 | 5 | 6 | 1 | 17 | 15 | 1 | 4
26 | 6 | 6 | 1 | 16 | 9 | 1 | 5
27 | 7 | 6 | 1 | 11 | 8 | 1 | 6
28 | 8 | 6 | 1 | 7 | 7 | 1 | 7
29 | 9 | 6 | 1 | 3 | 6 | 1 | 8
30 | 10 | 6 | 1 | 1 | -1 | 0 | 9
(30 rows)

/* --e5 */
SELECT * FROM pgr_trsp_withPoints(
Expand All @@ -117,10 +118,10 @@ SELECT * FROM pgr_trsp_withPoints(
2 | 2 | -1 | 10 | 5 | 1 | 1 | 0.4
3 | 3 | -1 | 10 | 6 | 4 | 0.7 | 1.4
4 | 4 | -1 | 10 | -6 | 4 | 0.3 | 2.1
5 | 5 | -1 | 10 | 7 | 8 | 1 | 2.4
6 | 6 | -1 | 10 | 11 | 9 | 1 | 3.4
7 | 7 | -1 | 10 | 16 | 15 | 0.4 | 4.4
8 | 8 | -1 | 10 | -2 | 15 | 0.6 | 4.8
5 | 5 | -1 | 10 | 7 | 10 | 1 | 2.4
6 | 6 | -1 | 10 | 8 | 12 | 0.6 | 3.4
7 | 7 | -1 | 10 | -3 | 12 | 0.4 | 4
8 | 8 | -1 | 10 | 12 | 13 | 1 | 4.4
9 | 9 | -1 | 10 | 17 | 15 | 1 | 5.4
10 | 10 | -1 | 10 | 16 | 16 | 1 | 6.4
11 | 11 | -1 | 10 | 15 | 3 | 1 | 7.4
Expand Down Expand Up @@ -154,15 +155,14 @@ ELSE ' passes in front of'
(-1 => -6) at 4th step: | visits | Point | 6
(-1 => -3) at 4th step: | passes in front of | Point | 6
(-1 => 10) at 4th step: | passes in front of | Point | 6
(-1 => 10) at 6th step: | passes in front of | Vertex | 11
(-1 => 11) at 4th step: | passes in front of | Point | 6
(-1 => 11) at 6th step: | visits | Vertex | 11
(5 => -6) at 3th step: | visits | Point | 6
(5 => -3) at 3th step: | passes in front of | Point | 6
(5 => 10) at 3th step: | passes in front of | Point | 6
(5 => 11) at 3th step: | passes in front of | Point | 6
(5 => 11) at 5th step: | visits | Vertex | 11
(11 rows)
(10 rows)

/* --q2 */
SELECT * FROM pgr_trsp_withPoints(
Expand Down
2 changes: 1 addition & 1 deletion docqueries/utilities/findCloseEdges.result
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ FROM pgr_findCloseEdges(
NOTICE:
WITH
edges_sql AS (SELECT id, geom FROM edges),
point_sql AS (SELECT unnest('{0101000000CDCCCCCCCCCCFC3F9A9999999999D93F:0101000000333333333333D33FCDCCCCCCCCCCFC3F:0101000000CDCCCCCCCCCC04409A99999999990940:0101000000CDCCCCCCCCCC10403333333333330340:01010000003333333333330740CDCCCCCCCCCCFC3F:01010000009A99999999990140333333333333FB3F}'::geometry[]) AS point),
point_sql AS (SELECT unnest('{0101000000CDCCCCCCCCCCFC3F9A9999999999D93F:0101000000CDCCCCCCCCCC10403333333333330340:0101000000CDCCCCCCCCCC04409A99999999990940:0101000000333333333333D33FCDCCCCCCCCCCFC3F:01010000003333333333330740CDCCCCCCCCCCFC3F:01010000009A99999999990140333333333333FB3F}'::geometry[]) AS point),
results AS (
SELECT
id::BIGINT AS edge_id,
Expand Down
Loading