D 2018-04-04T11:49:39.363 L VirtualRouting P 560b566ff8ec2df7c7fee801f022829f701cb079 U sandro W 65205 back
Technical noteThe internal encoding adopted by the Binary Data Table is unchanged and is the same for both VirtualNetwok and VirtualRouting.You can safely base a VirtualRouting Table on any existing Binary Data Table created by the spatialite-network CLI tool, exactly as you can base a VirtualNetwork Table on any Binary Data Table created by the CreateRouting() SQL function. WarningIn the case of Spatial Networks based on any geographic Reference System (using longitudes and latitudes) there is an important difference between Binary Data Tables created by the spatialite_network GUI tool and Binary Data Tables created by the CreateRouting() SQL function when costs are implicitly based on the geometric length of the Link's Linestring:
|
Highlight: where you areYou've just created two VirtualRouting Tables based on different settings; both them are perfectly valid and reasonable, but they are intended for different purposes:
Conclusion: a single VirtualRouting Table can't be able to adequately support support the specific requirements and expectations of different users. Defining more Routing Tables with different settings for the same Network usually is a good design choice leading to more realistic results. |
Handling dynamic NetworksSometimes it happens that a Network could be subject to rather frequent changes: some new Links require to be added, obsolete Links require to be removed, other Links may assume a different Cost, one-ways could be reversed, the discipline of pedestrian areas could be modified and so on.A VirtualRouting Table is always based on a companion Binary Data Table, that is intrinsically static, and consequently you are required to re-create both them from time to time in order to support all recent changes affecting the underlaying Network. The optimal frequency for cyclically refreshing the Routing Tables strictly depends on specific requirements, but the two overall approaches are commonly adopted:
|
Warning: how to correctly drop Network TablesWhen dropping a VirtualRouting Table and its companion Binary Data Table following the correct sequence of SQL commands is paramount.Failing to strictly respect the expected sequence will surely cause you several troubles and severe headaches, and will possibly lead to an irremediably corrupted database.
|
Algorithm | Request | Options | Delimiter | RouteId | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | PointFrom | PointTo | Tolerance | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dijkstra | Shortest Path | Full | , [dec=44, hex=2c] | 0 | 0 | Route | NULL | 178731 | 183286 | NULL | NULL | NULL | 300.912208 | BLOB sz=272 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 0 | 1 | Link | 224014 | 178731 | 182885 | NULL | NULL | NULL | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | NULL | NULL | 0 | 2 | Link | 224446 | 182885 | 178880 | NULL | NULL | NULL | 69.727726 | NULL | VIA MARGARITONE |
NULL | NULL | NULL | NULL | 0 | 3 | Link | 224414 | 178880 | 183286 | NULL | NULL | NULL | 136.372057 | NULL | VIA MARGARITONE |
RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|
0 | Route | NULL | 183286 | 178731 | 300.912208 | BLOB sz=272 GEOMETRY | NULL |
1 | Link | 224414 | 183286 | 178880 | 136.372057 | NULL | VIA MARGARITONE | 2 | Link | 224446 | 178880 | 182885 | 69.727726 | NULL | VIA MARGARITONE |
3 | Link | 224014 | 182885 | 178731 | 94.812424 | NULL | VIA PIETRO ARETINO |
RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|
0 | Route | NULL | 178731 | 183286 | 101.815552 | BLOB sz=2032 GEOMETRY | NULL |
1 | Link | 224014 | 178731 | 182885 | 13.127874 | NULL | VIA PIETRO ARETINO |
2 | Link | 224446 | 182885 | 178880 | 9.654608 | NULL | VIA MARGARITONE |
3 | Link | 219171 | 178880 | 178732 | 7.809952 | NULL | VIA FRANCESCO CRISPI |
4 | Link | 219058 | 178732 | 178754 | 12.445626 | NULL | VIA FRANCESCO CRISPI |
5 | Link | 225888 | 178754 | 183461 | 1.599865 | NULL | VIA FRANCESCO CRISPI |
6 | Link | 225887 | 183461 | 182800 | 3.300590 | NULL | VIA FRANCESCO CRISPI |
7 | Link | 223935 | 182800 | 182799 | 6.688786 | NULL | VIALE LUCA SIGNORELLI |
8 | Link | 226038 | 182799 | 183456 | 1.294017 | NULL | VIALE LUCA SIGNORELLI |
9 | Link | 225832 | 183456 | 183444 | 2.385486 | NULL | VIALE LUCA SIGNORELLI |
10 | Link | 225831 | 183444 | 183554 | 3.160662 | NULL | VIALE LUCA SIGNORELLI |
11 | Link | 225765 | 183554 | 183954 | 7.469917 | NULL | VIALE LUCA SIGNORELLI |
12 | Link | 225766 | 183954 | 183905 | 3.236389 | NULL | VIALE LUCA SIGNORELLI |
13 | Link | 225979 | 183905 | 183626 | 13.983629 | NULL | STRADA SENZA NOME |
14 | Link | 224905 | 183626 | 183128 | 5.627358 | NULL | STRADA SENZA NOME |
15 | Link | 224897 | 183128 | 183286 | 10.030792 | NULL | VIA MARGARITONE |
RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|
0 | Route | NULL | 183286 | 178731 | 103.305259 | BLOB sz=944 GEOMETRY | NULL |
1 | Link | 224414 | 183286 | 178880 | 18.882285 | NULL | VIA MARGARITONE |
2 | Link | 219171 | 178880 | 178732 | 7.809952 | NULL | VIA FRANCESCO CRISPI |
3 | Link | 219058 | 178732 | 178754 | 12.445626 | NULL | VIA FRANCESCO CRISPI |
4 | Link | 224538 | 178754 | 181972 | 7.047784 | NULL | VIA ANTONIO GUADAGNOLI |
5 | Link | 222575 | 181972 | 181971 | 1.852283 | NULL | VIA ANTONIO GUADAGNOLI | 6 | Link | 224967 | 181971 | 182891 | 14.273185 | NULL | VIA ANTONIO GUADAGNOLI |
7 | Link | 224168 | 182891 | 183057 | 6.643309 | NULL | VIA MACALLE' |
8 | Link | 224167 | 183057 | 183056 | 3.151272 | NULL | VIA MACALLE' |
9 | Link | 224174 | 183056 | 182941 | 7.966870 | NULL | VIA RODI |
10 | Link | 224059 | 182941 | 182001 | 6.393747 | NULL | VIA RODI |
11 | Link | 222637 | 182001 | 182000 | 2.475538 | NULL | VIA PIETRO ARETINO |
12 | Link | 222636 | 182000 | 178731 | 14.363408 | NULL | VIA PIETRO ARETINO |
Linestrings returned by VirtualRoutingAll LINESTRING Geometries created by any VirtualRouting will always contain M values:
In other words, all Linestrings returned by VirtualRouting can effectively support LR (Linear Referencing) SQL functions, as in the following examples: (assuming the same path returned by the latest bycar query). |
![]() |
Algorithm | Options | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|
A* | Full | 0 | Route | NULL | 178731 | 183286 | 300.912208 | BLOB sz=272 GEOMETRY | NULL |
NULL | NULL | 1 | Link | 224014 | 178731 | 182885 | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | 2 | Link | 224446 | 182885 | 178880 | 69.727726 | NULL | VIA MARGARITONE |
NULL | NULL | 3 | Link | 224414 | 178880 | 183286 | 136.372057 | NULL | VIA MARGARITONE |
Algorithm | Options | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|
A* | No Links | 0 | Route | NULL | 178731 | 183286 | 300.912208 | BLOB sz=272 GEOMETRY | NULL |
Algorithm | Options | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|
A* | No Geometries | 0 | Route | NULL | 178731 | 183286 | 300.912208 | NULL | NULL |
NULL | NULL | 1 | Link | 224014 | 178731 | 182885 | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | 2 | Link | 224446 | 182885 | 178880 | 69.727726 | NULL | VIA MARGARITONE |
NULL | NULL | 3 | Link | 224414 | 178880 | 183286 | 136.372057 | NULL | VIA MARGARITONE |
Algorithm | Options | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|
A* | Simple | 0 | Route | NULL | 178731 | 183286 | 300.912208 | NULL | NULL |
Algorithm | Request | Options | Delimiter | RouteId | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Dijkstra | Shortest Path | Full | , [dec=44, hex=2c] | 0 | 0 | Route | NULL | 178731 | 183882 | 154.750839 | BLOB sz=240 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 0 | 1 | Link | 222636 | 178731 | 182000 | 103.735722 | NULL | VIA PIETRO ARETINO |
NULL | NULL | NULL | NULL | 0 | 2 | Link | 225527 | 182000 | 183882 | 51.015117 | NULL | VIA LICIO NENCETTI |
NULL | NULL | NULL | NULL | 1 | 0 | Route | NULL | 178731 | 184030 | 176.364755 | BLOB sz=304 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 1 | 1 | Link | 224014 | 178731 | 182885 | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | NULL | NULL | 1 | 2 | Link | 224862 | 182885 | 182043 | 37.095287 | NULL | VIA MARGARITONE |
NULL | NULL | NULL | NULL | 1 | 3 | Link | 226070 | 182043 | 184030 | 44.457044 | NULL | PIAZZA SANT'AGOSTINO |
NULL | NULL | NULL | NULL | 2 | 0 | Route | NULL | 178731 | 178754 | 224.677095 | BLOB sz=240 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 2 | 1 | Link | 219045 | 178731 | 178732 | 76.021007 | NULL | VIA ASSAB |
NULL | NULL | NULL | NULL | 2 | 2 | Link | 219058 | 178732 | 178754 | 148.656089 | NULL | VIA FRANCESCO CRISPI |
NULL | NULL | NULL | NULL | 3 | 0 | Route | NULL | 178731 | 181999 | 260.132354 | BLOB sz=240 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 3 | 1 | Link | 224014 | 178731 | 182885 | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | NULL | NULL | 3 | 2 | Link | 224446 | 182885 | 178880 | 69.727726 | NULL | VIA MARGARITONE |
NULL | NULL | NULL | NULL | 3 | 3 | Link | 225800 | 178880 | 181999 | 95.592204 | NULL | VIA FRANCESCO CRISPI |
NULL | NULL | NULL | NULL | 4 | 0 | Route | NULL | 178731 | 183286 | 300.912208 | BLOB sz=272 GEOMETRY | NULL |
NULL | NULL | NULL | NULL | 4 | 1 | Link | 224014 | 178731 | 182885 | 94.812424 | NULL | VIA PIETRO ARETINO |
NULL | NULL | NULL | NULL | 4 | 2 | Link | 224446 | 182885 | 178880 | 69.727726 | NULL | VIA MARGARITONE |
NULL | NULL | NULL | NULL | 4 | 3 | Link | 224414 | 178880 | 183286 | 136.372057 | NULL | VIA MARGARITONE |
NULL | NULL | NULL | NULL | NULL | NULL | Unreachable NodeTo | NULL | 178731 | 290458 | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NULL | NULL | Unreachable NodeTo | NULL | 178731 | 124622 | NULL | NULL | NULL |
Algorithm | Request | Options | Delimiter | RouteId | RouteRow | Role | LinkRowid | NodeFrom | NodeTo | Cost | Geometry | Name |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Dijkstra | Shortest Path | Full | , [dec=44, hex=2c] | 0 | 0 | Route | NULL | 178731 | 183882 | 154.750839 | NULL | NULL |
NULL | NULL | NULL | NULL | 1 | 0 | Route | NULL | 178731 | 184030 | 176.364755 | NULL | NULL |
NULL | NULL | NULL | NULL | 2 | 0 | Route | NULL | 178731 | 178754 | 224.677095 | NULL | NULL |
NULL | NULL | NULL | NULL | 3 | 0 | Route | NULL | 178731 | 181999 | 260.132354 | NULL | NULL |
NULL | NULL | NULL | NULL | 4 | 0 | Route | NULL | 178731 | 183286 | 300.912208 | NULL | NULL |
NULL | NULL | NULL | NULL | NULL | NULL | Unreachable NodeTo | NULL | 178731 | 290458 | NULL | NULL | NULL |
NULL | NULL | NULL | NULL | NULL | NULL | Unreachable NodeTo | NULL | 178731 | 124622 | NULL | NULL | NULL |