Skip to contents

get_geography() downloads and caches the geometries and data defined by a specified ASGS geography, with optional filtering using SQL or spatial queries.

Usage

get_geography(
  geography,
  identifier = NULL,
  edition = NULL,
  reference_date = NULL,
  layer = c("gen", "full", "point"),
  where = NULL,
  filter_geom = NULL,
  predicate = c("intersects", "contains", "crosses", "overlaps", "touches", "within"),
  cache = getOption("ozgs.cache"),
  ...
)

Arguments

geography

The name of the ASGS geography to download. Valid choices are ADD, AUS, CED, DZN, GCCSA, IARE, ILOC, IREG, LGA, MB, NRMR, POA, RA, S/T, SA1, SA2, SA3, SA4, ..., TR, and UCL.

identifier

An optional character vector of named features to download from the specified geography. For most ASGS geographies, these are human-friendly names like e.g. "Tasmania" (a feature within the STE geography), "Sydney" (a feature within the LGA geography) or "2150" (a feature within the POA geography). If specified, identifier takes precedence over where. If neither identifier nor where are specified, all of the features in the specified geography will be downloaded.

edition

An ASGS edition: 1, 2, or 3.

reference_date

The geography's year of release. For most geographies, reference_year is optional and specifying an edition will be sufficient. However, for LGAs, CEDs and SEDs, the ASGS contains multiple releases per edition. For these geographies, a reference_date must be supplied to uniquely identify a release.

layer

One of:

  • "gen", the default. Fetches simplified geometries that have been generalised to 0.000025° or 2.5m.

  • "full", full ASGS geometries. Identical to ASGS Shapefile and Geopackage downloads.

  • "point", point geometries for each records in a geography.

where

An optional SQL WHERE clause to filter the features returned by the request. Ignored if identifier is specified.

filter_geom

An optional sf::sfc or single sf geometry to filter the records returned by the request.

predicate

An optional spatial predicate to specify the relation between filter_geom and geography. One of "intersects", "contains", "crosses", "overlaps", "touches", and "within".

cache

A cachem-compatible cache. If not otherwise specified, defaults to a memory cache. To persistently store downloaded ASGS geometries and data, supply an object created by cachem::cache_disk().

...

Additional arguments passed to arcgislayers::arc_read().

Value

Returns a sf spatial data frame with geometry and data for the requested ASGS geography.