1..
2   ****************************************************************************
3    pgRouting Manual
4    Copyright(c) pgRouting Contributors
5
6    This documentation is licensed under a Creative Commons Attribution-Share
7    Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
8   ****************************************************************************
9
10|
11
12* **Supported versions:**
13  `Latest <https://docs.pgrouting.org/latest/en/sampledata.html>`__
14  (`3.2 <https://docs.pgrouting.org/3.2/en/sampledata.html>`__)
15  `3.1 <https://docs.pgrouting.org/3.1/en/sampledata.html>`__
16  `3.0 <https://docs.pgrouting.org/3.0/en/sampledata.html>`__
17* **Unsupported versions:**
18  `2.6 <https://docs.pgrouting.org/2.6/en/sampledata.html>`__
19  `2.5 <https://docs.pgrouting.org/2.5/en/sampledata.html>`__
20  `2.4 <https://docs.pgrouting.org/2.4/en/sampledata.html>`__
21  `2.3 <https://docs.pgrouting.org/2.3/en/doc/src/developer/sampledata.html>`__
22  `2.2 <https://docs.pgrouting.org/2.2/en/doc/src/developer/sampledata.html>`__
23  `2.1 <https://docs.pgrouting.org/2.1/en/doc/src/developer/sampledata.html>`__
24  `2.0 <https://docs.pgrouting.org/2.0/en/doc/src/developer/sampledata.html>`__
25
26Sample Data
27===============================================================================
28
29The documentation provides very simple example queries based on a small sample network.
30To be able to execute the sample queries, run the following SQL commands to create a table with a small network data set.
31
32
33.. rubric:: Create table
34
35.. literalinclude:: ../../tools/testers/sampledata.sql
36   :start-after: --EDGE TABLE CREATE start
37   :end-before: --EDGE TABLE CREATE end
38
39
40.. rubric:: Insert data
41
42.. literalinclude:: ../../tools/testers/sampledata.sql
43   :start-after: --EDGE TABLE ADD DATA start
44   :end-before: --EDGE TABLE ADD DATA end
45
46
47.. rubric:: Updating geometry
48
49.. literalinclude:: ../../tools/testers/sampledata.sql
50   :start-after: --EDGE TABLE update geometry start
51   :end-before: --EDGE TABLE update geometry end
52
53
54.. rubric:: Topology
55
56- Before you test a routing function use this query to create a topology (fills the ``source`` and ``target`` columns).
57
58.. literalinclude:: ../../tools/testers/sampledata.sql
59   :start-after: --EDGE TABLE TOPOLOGY start
60   :end-before: --EDGE TABLE TOPOLOGY end
61
62.. rubric:: Combinations of start and end vertices
63
64- Used to test the combinations_sql signature in dijkstra-like functions.
65
66.. literalinclude:: ../../tools/testers/sampledata.sql
67   :start-after: --COMBINATIONS CREATE start
68   :end-before: --COMBINATIONS CREATE end
69
70.. rubric:: Points of interest
71
72- When points outside of the graph.
73- Used with the :doc:`withPoints-family` functions.
74
75.. literalinclude:: ../../tools/testers/sampledata.sql
76   :start-after: --POINTS CREATE start
77   :end-before: --POINTS CREATE end
78
79.. rubric:: Restrictions
80
81- Used with the :doc:`pgr_trsp` functions.
82
83.. literalinclude:: ../../tools/testers/sampledata.sql
84   :start-after: --RESTRICTIONS CREATE start
85   :end-before: --RESTRICTIONS CREATE end
86
87Images
88----------------
89
90* Red arrows correspond when ``cost`` > 0 in the edge table.
91* Blue arrows correspond when ``reverse_cost`` > 0 in the edge table.
92* Points are outside the graph.
93* Click on the graph to enlarge.
94
95.. _fig1:
96
97Network for queries marked as ``directed`` and ``cost`` and ``reverse_cost`` columns are used
98......................................................................................................
99
100When working with city networks, this is recommended for point of view of vehicles.
101
102
103.. figure:: /images/Fig1-originalData.png
104
105   **Graph 1: Directed, with cost and reverse cost**
106
107.. _fig2:
108
109Network for queries marked as ``undirected`` and ``cost`` and ``reverse_cost`` columns are used
110......................................................................................................
111
112When working with city networks, this is recommended for point of view of pedestrians.
113
114
115.. figure:: /images/Fig6-undirected.png
116   :scale: 50%
117
118   **Graph 2: Undirected, with cost and reverse cost**
119
120.. _fig3:
121
122Network for queries marked as ``directed`` and only ``cost`` column is used
123......................................................................................................
124
125
126
127.. figure:: /images/Fig2-cost.png
128   :scale: 20%
129
130   **Graph 3: Directed, with cost**
131
132.. _fig4:
133
134Network for queries marked as ``undirected`` and only ``cost`` column is used
135......................................................................................................
136
137
138.. figure:: /images/Fig4-costUndirected.png
139   :scale: 20%
140
141   **Graph 4: Undirected, with cost**
142
143
144.. _pickdeliverdata:
145
146
147Pick & Deliver Data
148...............................................................................
149
150.. literalinclude:: ../../tools/testers/vrppdtw_data.sql
151
152
153