Road Network
There are 138 locations in the network that this service provides; each is labelled with an integer index.
These indexes starting from 0
and increase monotonically until 137
(inclusive) - the index of a location does not necessarily bear any correlation to its physical location, region, name, etc.
Two services are provided to give you access to the connections between the locations, and information about the locations themselves.
The road-network/information
service provides information about a location given its index.
Information about multiple locations can be requested at once if necessary.
The response is a csv file with five columns; "index
", "name
", "depot
" "x
", "y
";
index
is an integer, corresponding to the location's index. This is returned so that if you are requesting information about multiple locations at once, you can map the indexes you provided to the correspondingcsv
rows.name
is the name of the location.region
is the region the location belongs to.depot
is eitherTRUE
orFALSE
, and should be interpreted as a boolean value. IfTRUE
, the location is a depot, otherwise it is not.x
andy
are the physical coordinates of the location. (This can be useful if you want to plot the road network).
The road-network/connections
service provides the edge table of connections between the locations.
It does not accept any parameters to its queries - it always provides the complete edge table as a csv
file with three columns;
index1
&index2
contain the indexes of the two locations that have a direct connection.travel time (mins)
is the time (in mins) that it takes to travel between the two locations. (These values apply before considering relative travel speeds).
Querying
To query for information about the locations with indexes X, Y, and Z:
road-network/information?id=X,Y,Z
road-network/information?id=X&id=Y&id=Z
Query for the information about all locations:
road-network/information?id=all
road-network/information
To query for the edge table:
road-network/connections
Parameters
id
: A series of integer values corresponding to location indexes. Information will be retrieved for each unique location, and will be returned sorted by the location index. Defaults toall
if not provided.
Examples
https://rse-with-python.arc.ucl.ac.uk/delivery-info/road-network/information?id=0,1,2
- fetch information about stations with index 0, 1, 2, and 3.https://rse-with-python.arc.ucl.ac.uk/delivery-info/road-network/information?id=0&id=1&id=2
- same as the example above, alternative syntax.https://rse-with-python.arc.ucl.ac.uk/delivery-info/road-network/connections
- fetch the edge table describing the road network.
Return format
The road-network/information
service will return a .csv
file with headers where each row contains the following information about the requested locations:
index, name, region, depot, x, y
Values in the columns are (respectively) of type int
, str
, str
, bool
, float
, and float
.
Columns are not guaranteed to be in this order.
The road-network/connections
service will return a .csv
file with headers where each row describes a single (two-way) connection between locations:
index1, index2, travel time (mins)
Values in the columns are (respectively) of type int
, int
, and float
.