The purpose of this tutorial is:
The end goal of this tutorial is for R users with minimal spatial experience to be able to search for, download and visualise Vicmap data. While this tutorial is aimed at spatial beginners, it can still be used as a reference for more experienced users.
vicspatial is the R package that connects to the Victorian Government’s catalogue of spatial datasets. The catalogue features 489 datasets across land, property, infrastructure and environment and is the most authoritative suite of spatial data in Victoria.
This data catalogue is freely available to the public and can be accessed via several methods. For users of R, the fastest way to access up to date vicspatial datasets is to utilise the Web Feature Service (WFS). WFS is a standardised interface to request geographic information, regardless of the platform on which it is stored.
WFS requires a URL that contains the instructions for the query and is written in WFS specific terminology. This of course requires understanding of the WFS terminology and the time-consuming process of manually building the URL string.
vicspatial simplifies WFS queries by taking user supplied keywords
and automatically building the correctly formatted URL string.
The functions in vicspatial therefore provide a much faster and more
robust method for acquiring data.
vicspatial uses lazy evaluation, in which we query but do not collect the data from the WFS database. This is called making a ‘Promise’. A promise contains the dataset information but not the data itself. This promise can be filtered for a subset of the data before collecting. Using lazy evaluation we can collect the desired subset, instead of the entire dataset.
Note: A previous version of this tutorial used swooping birds as the example, but due to the migration of platforms that data was not available at time of writing
To demonstrate vicspatial’s features, we will download and explore a dataset from the data catalogue. The data is a spatial dataset of Melbourne’s open space network.
First, we need to search for the dataset. We can view all layers, or
do a keyword search. Use ignore.case = TRUE
for a
case-insensitive search. listLayers()
by default now
provides a column of ‘Abstract’ and ‘metadataID’. You can remove these
columns by setting the abstract argument to FALSE
(e.g. listLayers(abstract = FALSE)
)
#All layers
all_layers <- listLayers()
# Case insensitive keyword search
search <- listLayers(pattern = "veac", ignore.case = T)
Viewing our search results shows us the name of the dataset and its description.
Name | Title | Abstract | metadataID |
---|---|---|---|
open-data-platform:plm25 | plm25 | This dataset describes public land management for the State of Victoria, where Public Land is defined as land held by/vested in/or owned by DEECA and other government departments, public authorities, Commonwealth government and municipalities. Refer to VEAC Act 2001 for more details. |
Public land includes state forests, parks and reserved and unreserved Crown land, including estuarine, coastal and marine areas to the 3 nautical mile limit (5.5 km) from the high watermark. This layer is represented at a scale of 1:25 000 and describes the primary management, land manager and the VEAC recommendations.
PLM25 is a derived layer, using VMPROP.PARCEL_CROWN_APPROVED as the base layer. It relies on tabular and spatial sources to get the land description. PORTAL, PRIMS are the tabular sources of information. PARKRES, VEACRECS25 and CL_TENURE are the spatial sources. Additional layers were also created to describe areas of state forests, plantations, water frontages and commonwealth land.
PLM25 has replaced the old PLM100 datasets.
Any errors can be reported to Plm25.info@delwp.vic.gov.au |7cb9cfb1-86ff-5432-bf9b-e3070d04f507 | |open-data-platform:veac_metro_open_space |veac_metro_open_space |The dataset consists of polygons delineating areas of public land(1) and local council land(2) that have been classified as public open space. Polygon attributes describe the public open space category and owner. The datset covers 31 municipalities in metropolitan Melbourne.
The definition used to attribute a polyon as public open space is ‘those areas of public land and local council land that have an accepted and ongoing community use for outdoor recreation and informal activities, and that are freely accessible to the public’.
The VEAC Metropolitan Melbourne Open Space Inventory does not include Commonwealth land; schools; cemeteries; gated facilities; road plantations; closed roads; concourses around stadia; inaccessible Trust for Nature properties; ‘services and utilities’ public land that does not have an ongoing recreational use; future open space (e.g. areas covered by Public Aquisition Overlays); and uncategorised public land.
‘Public Land’ is Crown land and freehold land owned by Victorian Government Agencies.
‘Local Council Land’ is freehold land owned by local councils. |9362b7a4-3615-5d67-a6bf-e8693d535eb7 |
Once we have the name of the dataset we would like to download, in this case ‘open-data-platform:veac_metro_open_space’, we can query the Vicmap database.
If we are still not sure from the name and description that this is the right dataset, we can look at the promise to get a snippet of the dataset contents.
vicmap_query(layer = "open-data-platform:veac_metro_open_space")
#> • Using collect() on this object will return 19108
#> • features and 13 fields
#> • At most six rows of the record are printed here
#> ────────────────────────────────────────────────────────────────────────────────
#> Simple feature collection with 6 features and 12 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: 144.9109 ymin: -38.15803 xmax: 145.1953 ymax: -37.62895
#> Geodetic CRS: GDA94
#> # A tibble: 6 × 13
#> id reference_p ownername_summary ha os_group veac_id os_id
#> <chr> <chr> <chr> <dbl> <chr> <chr> <int>
#> 1 veac_metro_open_s… M016559 Municipal 0.325 Natural… M016559 5920
#> 2 veac_metro_open_s… M016563 Municipal 0.291 Natural… M016563 5923
#> 3 veac_metro_open_s… M016570 Municipal 0.978 Natural… M016570 5928
#> 4 veac_metro_open_s… M016576 Municipal 0.0705 Natural… M016576 5879
#> 5 veac_metro_open_s… M018543 Municipal 0.0169 Parklan… M018543 7839
#> 6 veac_metro_open_s… M018552 Municipal 0.0199 Parklan… M018552 7848
#> # ℹ 6 more variables: dominant_lga_name <chr>, majority_parcel_spi <chr>,
#> # majority_parcel_pfi <chr>, name <chr>, polygon_source <chr>,
#> # geometry <MULTIPOLYGON [°]>
We can see that the dataset contains the route numbers and names. At
a glance this data should be adequate. If you want more extensive
information of the data you can use get_metadata()
to
download a list of (i) metadata about the data, (ii) a data dictionary
(work-in-progress) and (iii) a link to the metadata url.
metadata <- vicmap_query(layer = "open-data-platform:veac_metro_open_space") %>%
get_metadata() %>%
.[[1]]
kbl(metadata) %>%
kable_styling()
Metadata Name | Descriptions |
---|---|
Resource Name | VEAC_METRO_OPEN_SPACE |
Title | VEAC Metropolitan Melbourne Open Space Inventory |
Anzlic ID | ANZVI0803004707 |
Custodian | NA |
Owner | NA |
Jurisdiction | Victoria |
Abstract |
The dataset consists of polygons delineating areas of public land(1) and local council land(2) that have been classified as public open space. Polygon attributes describe the public open space category and owner. The datset covers 31 municipalities in metropolitan Melbourne. The definition used to attribute a polyon as public open space is ‘those areas of public land and local council land that have an accepted and ongoing community use for outdoor recreation and informal activities, and that are freely accessible to the public’. The VEAC Metropolitan Melbourne Open Space Inventory does not include Commonwealth land; schools; cemeteries; gated facilities; road plantations; closed roads; concourses around stadia; inaccessible Trust for Nature properties; ‘services and utilities’ public land that does not have an ongoing recreational use; future open space (e.g. areas covered by Public Aquisition Overlays); and uncategorised public land.
|
Search Words |
Planning cadastre , Society , Boundaries |
Purpose |
The dataset was created to provide a comprehensive spatial inventory of open space public land and to inform discussion on open space issues in metropolitan Melbourne. |
Geographic Extent Polygon |
NA |
Geographic Bounding Box |
NA |
Beginning to Ending Date |
2009-09-15 - 2011-08-30 |
Maintainence and Update Frequency |
As needed |
Stored Data Format |
NA |
Available Format(s) Types |
Digital all digital formats |
Positional Accuracy |
Input datasets have varying positional accuracies. Where possible Melbourne Open Space Inventory polygons were referenced back to the cadastre. However, not all polygon boundaries are coincident with cadastral parcels. This occurs for some polygons where one or more edges were digitised from 35cm resolution aerial imagery (January 2009 and December 2010). |
Attribute Accuracy |
Not Known |
Logical Consistency |
Topology rules were implemented using ArcGIS to ensure no overlaps or gaps. All polygons are attributed with an open space type and an owner type. |
Data Source |
Dataset Source: The following source datasets were used in the compilation of The Melbourne Open Space Inventory; The Department of Sustainability and Environment’s VM Crown Land parcels dataset, Victorian Government agency land datasets, the ARCUE 2002 open space database, the Victorian online planning schemes database, Parks Victoria’s Metropolitan Trail Network dataset and some local council open space datasets. Dataset Originality: Derived |
Contact Organisation | DEECA |
Contact Position | NA |
Address | NA |
Telephone | NA |
Facsimile | NA |
Email Address | NA |
Metadata Date |
2025-07-17T14:56:07
|
Additional Metadata |
History: This dataset was based on the ARCUE 2002 open space datasbase and updated for all Melbourne metropolitan suburbs for the VEAC Metropolitan Melbourne Investigation. Relationship to other Datasets: ARCUE 2002 Open Space Database Future Design Issues: No future work is planned. Related Documents: Metropolitan Melbourne Investigation Discussion Paper VEAC August 2011. - A copy of this report is located at www.veac.vic.gov.au,Metropolitan Melbourne Investigation Discussion Paper VEAC October 2010. - A copy of this report is located at www.veac.vic.gov.au |
This isn’t a very large dataset, but if we are using this data in an interactive report or application, waiting to download the full dataset may be impractical.
Using lazy evaluation, we can use pipes to filter and subset the data, so that we only collect the desired subset. For example, let’s just look at the first 10 rows.
query <- vicmap_query(layer = "open-data-platform:veac_metro_open_space") %>%
head(10) %>% collect()
query
#> Simple feature collection with 10 features and 12 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: 144.9109 ymin: -38.15803 xmax: 145.2408 ymax: -37.62895
#> Geodetic CRS: GDA94
#> # A tibble: 10 × 13
#> id reference_p ownername_summary ha os_group veac_id os_id
#> <chr> <chr> <chr> <dbl> <chr> <chr> <int>
#> 1 veac_metro_open_… M016559 Municipal 0.325 Natural… M016559 5920
#> 2 veac_metro_open_… M016563 Municipal 0.291 Natural… M016563 5923
#> 3 veac_metro_open_… M016570 Municipal 0.978 Natural… M016570 5928
#> 4 veac_metro_open_… M016576 Municipal 0.0705 Natural… M016576 5879
#> 5 veac_metro_open_… M018543 Municipal 0.0169 Parklan… M018543 7839
#> 6 veac_metro_open_… M018552 Municipal 0.0199 Parklan… M018552 7848
#> 7 veac_metro_open_… M018564 Municipal 0.0226 Parklan… M018564 7860
#> 8 veac_metro_open_… M018567 Municipal 0.0207 Parklan… M018567 7863
#> 9 veac_metro_open_… M018570 Municipal 0.242 Parklan… M018570 7866
#> 10 veac_metro_open_… M018571 Municipal 0.512 Organis… M018571 7867
#> # ℹ 6 more variables: dominant_lga_name <chr>, majority_parcel_spi <chr>,
#> # majority_parcel_pfi <chr>, name <chr>, polygon_source <chr>,
#> # geometry <MULTIPOLYGON [°]>
Now let’s only look at the open space data. Note that vicspatial
datasets will retain id
and geometry
columns
even if not selected in the vicspatial promise. As this a simple
features (sf) dataset, the geometry corresponding to the features does
not need to be selected as it is always attached. The geometry column
can only be removed intentionally, for example, by using the
st_drop_geometry()
function in the sf
package.
veac_select <- vicmap_query(layer = "open-data-platform:veac_metro_open_space") %>%
filter(dominant_lga_name == "DAREBIN") %>%
filter(ha > 0.1) %>%
select(id, ownername_summary, ha, os_group, dominant_lga_name, name) %>%
collect()
veac_select %>% head(5) %>%
select(-id) %>% #condense table for viewing
kable() %>%
kable_styling()
ownername_summary | ha | os_group | dominant_lga_name | name | geometry |
---|---|---|---|---|---|
Municipal | 12.5028986 | Natural and semi-natural area | DAREBIN | NO DATA | MULTIPOLYGON (((145.0273 -3… |
Municipal | 0.3046717 | Natural and semi-natural area | DAREBIN | NO DATA | MULTIPOLYGON (((144.9795 -3… |
Municipal | 0.5935187 | Natural and semi-natural area | DAREBIN | NO DATA | MULTIPOLYGON (((144.9856 -3… |
Municipal | 0.1358468 | Parkland and garden | DAREBIN | NO DATA | MULTIPOLYGON (((145.0117 -3… |
Municipal | 0.3614064 | Parkland and garden | DAREBIN | NO DATA | MULTIPOLYGON (((145.0034 -3… |
By filtering the Vicmap_promise
before
collecting, we have downloaded only a subset of rows of
data.
mapview
package
Often the first thing we want to do is see the data on a map. The
simplest and quickest way to visualise spatial data is to use the
mapview
package:
library(mapview)
mapviewOptions(fgb = FALSE)
# Because the dataset is not big we can download all the data as 'veac_area'
veac_area <- vicmap_query(layer = "open-data-platform:veac_metro_open_space") %>%
collect()
#> | | | 0% | |============ | 25% | |========================= | 50% | |====================================== | 75% | |==================================================| 100%
# plot data
mapview::mapview(veac_area)