Currently Under Development
Currently Under Development
The VicRoads Transport Open Data API is a new service under active development. As such it may be subject to changes, outages and data issues.
The Bluetooth site and link data will be decommissioned and no longer updated as of the
28th February 2019.
To access Bluetooth data please access the new
VicRoads Data Exchange Platform
Welcome to the VicRoads Transport Open Data API. This API provides near real time access to popular VicRoads
transport datasets in OGC Standard formats (WMS and WFS). The current datasets include:
-
vicroads:erc_point - Emergency Road Closure Points
Last processed: Unknown
-
vicroads:erc_line - Emergency Road Closure Lines
Last processed: Unknown
-
vicroads:bluetooth_sites - Bluetooth Travel Times for Sites (Intersections)
Last processed: Unknown
-
vicroads:bluetooth_links - Bluetooth Travel Times for Links (Road Segments)
Last processed: Unknown
-
vicroads:variable_speed_signs - Lane Use Management System Dynamic Speed Signs
Last processed: Unknown
-
vicroads:rwe_point - Roadworks and Events Points
Last processed: Unknown
-
vicroads:rwe_line - Roadworks and Events Lines
Last processed: Unknown
To get started with the API you will first need to request an API Token from
traffic_requests@vicroads.vic.gov.au.
In the e-mail please include the subject "API Token Request" and provide the following details within the body of the e-mail:
- Full name:
- E-mail address:
- Organisation (optional):
API tokens are used so that we can track usage of the API, and can be revoked in the event of misuse. Once you have a token it
must be included in every request in one of two ways:
- URL Parameter - Simply append AUTH=INSERT_YOUR_TOKEN as a URL parameter on every request (AUTH must be uppercase)
- HTTP Header - Add a HTTP 'Authorization' header formatted as 'Bearer INSERT_YOUR_TOKEN'
Request throttling is also applied to manage load on the servers. When requests exceed the throttling limits a
'503 Service Unavailable' error will be returned.
The available datasets are loaded on a 1 minute cycle, however this is dependent on a variety of upstream systems
so generally data will be a few minutes old. Data is loaded and served as-is from the source (no additional processing
or formatting is applied other than converting to the requested format).
All datasets are made available via OGC Standard services:
- Web Map Service (WMS) - For generating map images in PNG, JPEG, GIF, TIFF, GeoTIFF, SVG, PDF, KML, KMZ and UTFGrid Formats. More Info
- Web Feature Service (WFS) - For querying the underlying data in JSON, JSONP, Shapefile, CSV and GML (v2 and 3) Formats. More Info
Available datasets and sample queries are included in the following sections.
vicroads:erc_point
Emergency Road Closure Points
- id String
- incident_type String
- incident_status String
- comms_comment String
- road_closure_type String
- incident_publish String
- declared_road_number String
- declared_road_name String
- declared_road_direction String
- closed_road_name String
- closed_road_srns String
- closed_road_rma_class String
- closed_road_lga String
- closed_road_vr_region String
- closed_road_ses_region String
- closed_road_tram String
- closed_road_bus String
- incident_distance String
- incident_direction String
- incident_int_road_name String
- incident_locality String
- incident_melway String
- incident_vcsd String
- start_int_road_name String
- start_int_locality String
- end_int_roadname String
- end_int_locality String
- dt_created Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_updated Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_publish_until Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_last_ln_update Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- point_type String
- subj_name String
- subj_number String
- subj_type String
- subj_suffix String
- inc_int_road_name String
- inc_int_locality String
- erc_point Point EPSG:4326
vicroads:erc_line
Emergency Road Closure Lines
- id String
- incident_type String
- incident_status String
- comms_comment String
- road_closure_type String
- incident_publish String
- declared_road_number String
- declared_road_name String
- declared_road_direction String
- closed_road_name String
- closed_road_srns String
- closed_road_rma_class String
- closed_road_lga String
- closed_road_vr_region String
- closed_road_ses_region String
- closed_road_tram String
- closed_road_bus String
- incident_distance String
- incident_direction String
- incident_int_road_name String
- incident_locality String
- incident_melway String
- incident_vcsd String
- start_int_road_name String
- start_int_locality String
- end_int_roadname String
- end_int_locality String
- dt_created Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_updated Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_publish_until Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_last_ln_update Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- point_type String
- subj_name String
- subj_number String
- subj_type String
- subj_suffix String
- inc_int_road_name String
- inc_int_locality String
- erc_line LineString EPSG:4326
vicroads:bluetooth_sites
Bluetooth Congestion for Intersection Sites (Points)
- id String
- geom Point EPSG:4326
- mapname String
- name String
- beaconid String
- timestamp Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
vicroads:bluetooth_links
Bluetooth Congestion for Road Segments (Links)
- id String
- geom LineString EPSG:4326
- name String
- direction String
- congestion Double
- delay Double
- excess_delay Double
- trend String
- travel_time Double
- score Integer
- timestamp Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
vicroads:variable_speed_signs
Lane Use Management System Variable Speed Signs (Points)
- id String
- enabled Boolean
- reportedtime Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- current_lanenumber Integer
- current_panelvalue String
- current_annulusflashing Boolean
- previous_lanenumber Integer
- previous_panelvalue String
- previous_annulusflashing Boolean
- geom Point EPSG:4326
vicroads:rwe_point
Roadworks and Events
- rwe_id String
- rwe_type String
- rwe_closure_type String
- rwe_status String
- rwe_start_dt Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_end_dt Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_publish_text String
- subject_pref_rdname String
- start_pref_rdname String
- end_pref_rdname String
- lrs_start_locality String
- lrs_end_locality String
- lrs_rmaclass String
- lrs_srns String
- lrs_lga String
- lrs_ses_region String
- lrs_melway String
- lrs_vcsd String
- geom String
- works_type String
- traffic_delay String
- speed_limit String
- lanes_affected String
- days_applicable String
- dt_modified Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_created Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_point Point EPSG:4326
vicroads:rwe_line
Roadworks and Events
- rwe_id String
- rwe_type String
- rwe_closure_type String
- rwe_status String
- rwe_start_dt Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_end_dt Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_publish_text String
- subject_pref_rdname String
- start_pref_rdname String
- end_pref_rdname String
- lrs_start_locality String
- lrs_end_locality String
- lrs_rmaclass String
- lrs_srns String
- lrs_lga String
- lrs_ses_region String
- lrs_melway String
- lrs_vcsd String
- geom String
- works_type String
- traffic_delay String
- speed_limit String
- lanes_affected String
- days_applicable String
- dt_modified Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- dt_created Timestamp - Note: Date and Time is stored in GMT/UTC and should be converted to local time for display
- rwe_line LineString EPSG:4326
WMS Endpoint
Comprehensive WMS documentation is available on the
Geoserver site.
The most common type of WMS request is a GetMap request for a map image which can be structured as follows:
http://api.vicroads.vic.gov.au/vicroads/wms?
service=WMS&
version=1.1.1& - 1.1.1 or 1.3.0 are most widely used
request=GetMap&
layers=vicroads:bluetooth_links& - Layer name, separate multiple with comma
styles=red_point& - Optional named style on server, or can use 'sld_body' to pass custom SLD style
srs=EPSG:4326&
bbox=144.87,-38.64,145.64,-37.71& - Bounding box of output image
cql_filter=congestion>5& - Optional attribute or spatial filter using CQL
width=780&
height=330&
format=image/png& - Output image format
WMS Request - Get Capabilities:
http://api.vicroads.vic.gov.au/vicroads/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities&AUTH=%INSERT_TOKEN%
WMS Request - Get Map by Bounding Box:
http://api.vicroads.vic.gov.au/vicroads/wms?STYLES=&LAYERS=vicroads:bluetooth_sites&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=144.870,-38.640,145.645,-37.712&WIDTH=1400&HEIGHT=700&AUTH=%INSERT_TOKEN%
WMS Request - Get Map by Bounding Box and CQL Filter:
http://api.vicroads.vic.gov.au/vicroads/wms?STYLES=&LAYERS=vicroads:bluetooth_links&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&CQL_FILTER=congestion>5&BBOX=144.7,-38.1,145.3,-37.6&WIDTH=1400&HEIGHT=700&AUTH=%INSERT_TOKEN%
WFS Endpoint
Comprehensive WFS documentation is available on the
Geoserver site.
The most common type of WFS request is a GetFeature request for data:
http://api.vicroads.vic.gov.au/vicroads/wfs?
service=wfs&
version=2.0.0& - 1.1.0 or 2.0.0 are most widely used
request=GetFeature&
typeNames=vicroads:bluetooth_links& - Layer name, separate multiple with comma
outputformat=application/json& - Also supports 'csv', 'shape-zip' (Shapefile), 'GML2', 'GML3'
srsname=EPSG:4326&
bbox=144.87,-38.64,145.64,-37.71& - Optional bounding box filter
cql_filter=congestion>5& - Optional attribute or spatial filter using CQL
sortby=reportedtime+D& - Optional sort, +D (Descending) or +A (Ascending)
count=10 - Optional, leave it off to return everything
WFS Request - Get Capabilities:
http://api.vicroads.vic.gov.au/vicroads/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities&AUTH=%INSERT_TOKEN%
WFS Request - Get Features by Bounding Box (JSON):
http://api.vicroads.vic.gov.au/vicroads/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAMES=vicroads:bluetooth_sites&OUTPUTFORMAT=application/json&SRSNAME=EPSG:4326&BBOX=-38.348,144.686,-37.673,145.36&AUTH=%INSERT_TOKEN%
WFS Request - Get Features by CQL Filter (CSV):
http://api.vicroads.vic.gov.au/vicroads/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAMES=vicroads:bluetooth_sites&OUTPUTFORMAT=csv&SRSNAME=EPSG:4326&CQL_FILTER=name='MAROONDAH DEEP CREEK'&AUTH=%INSERT_TOKEN%
OpenLayers 3 (Javascript)
OpenLayers 3 is an open source, javascript web mapping library.
A full WMS example is available here.
Here is a simple example:
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'http://api.vicroads.vic.gov.au/vicroads/wms',
params: {
'LAYERS': 'vicroads:bluetooth_links',
'TILED': true,
'AUTH': 'insert_token'
},
serverType: 'geoserver'
})
})
],
target: 'map',
view: new ol.View({
projection: 'EPSG:4326',
center: [144.96, -37.81],
zoom: 10
})
});
Leaflet (Javascript)
http://leafletjs.com/examples/wms/wms.html
GDAL/OGR (Command Line / C / Python)
ogr2ogr Command Line: http://www.gdal.org/ogr2ogr.html
C / C++: http://www.gdal.org/ogr_apitut.html
Python: http://gdal.org/python/
Python WFS: https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#get-wfs-layers-and-iterate-over-features
WMS: http://www.gdal.org/frmt_wms.html
WFS: http://www.gdal.org/drv_wfs.html
wfs-client (Node JS)
https://www.npmjs.com/package/wfs-client
OWSLib (Python)
https://geopython.github.io/OWSLib/
GeoTools (Java)
http://docs.geotools.org/stable/userguide/extension/wms/index.html
http://docs.geotools.org/stable/userguide/library/data/wfs.html
MapBox
https://www.mapbox.com/developers/
Carto
https://carto.com/docs/
Please refer to Data.Vic for metadata on the respective datasets.
Creative Commons licence
The VicRoads Transport Open Data API is licensed under a Creative Commons Attribution 4.0 International licence.
Creative Commons Attribution 4.0 International Licence is a standard form licence agreement that allows you to copy, distribute, transmit and adapt the VicRoads Transport Open Data API provided that you attribute the work. Both a summary of the licence terms and the full licence terms are available online from Creative Commons.
Disclaimer
The VicRoads Transport Open Data API is provided “as is” and VicRoads is not liable for how you use this data, how third parties use or rely on this data or any errors contained within the data. You are responsible for determining whether the VicRoads Transport Open Data API is suitable for your particular usage and purposes.
For more information refer to Data.Vic for metadata and licensing on the relevant dataset(s).
To request an API Token refer to the Overview section above.