https://github.com/cidm-ph/nswgeo
Geospatial data and maps for New South Wales, Australia
https://github.com/cidm-ph/nswgeo
geospatial geospatial-data r
Last synced: 3 months ago
JSON representation
Geospatial data and maps for New South Wales, Australia
- Host: GitHub
- URL: https://github.com/cidm-ph/nswgeo
- Owner: cidm-ph
- License: other
- Created: 2022-11-15T06:10:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-19T22:36:18.000Z (3 months ago)
- Last Synced: 2026-03-20T13:36:20.456Z (3 months ago)
- Topics: geospatial, geospatial-data, r
- Language: R
- Homepage: https://cidm-ph.github.io/nswgeo/
- Size: 23.9 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
editor_options:
markdown:
wrap: 72
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(sf, quietly = TRUE)
set.seed(2022)
```
# nswgeo
[](https://cidm-ph.r-universe.dev)
[](https://github.com/cidm-ph/nswgeo/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=nswgeo)
A collection of geospatial datasets and map plotting helpers for working
with New South Wales maps. The maps are registered with `{cartographer}`.
This package is not an official publication, merely a collection of handy data
from public sources.
## Installation
You can install nswgeo like so:
``` r
# CRAN release
install.packages('nswgeo')
# development version
install.packages('nswgeo', repos = c('https://cidm-ph.r-universe.dev', 'https://cloud.r-project.org'))
```
## Examples
The data can be used directly with ggplot:
```{r ggplot, fig.width=5, fig.height=4.7, fig.dpi=300}
library(nswgeo)
library(ggplot2)
ggplot(nswgeo::nsw) +
geom_sf(fill = "white", data = nswgeo::australia) +
geom_sf(fill = "#9BCBEB", colour = NA) +
geom_sf(fill = NA, colour = "white", data = nswgeo::lhd) +
geom_sf(fill = NA, colour = "#002664", linewidth = .8) +
annotate(
"text", x = 144, y = -27, label = "New South Wales",
angle = -5, size = 5, fontface = "italic", colour = "#002664"
) +
coord_sf(crs = crs_gda2020_albers(), default_crs = crs_gda2020()) +
theme_minimal() +
theme(
panel.background = element_rect(fill = "grey97", colour = NA),
axis.title = element_blank(),
)
```
Alternatively, the data can be accessed through `{cartographer}`:
```{r cartographer}
library(cartographer)
head(covid_cases_nsw)
covid_cases_nsw |>
dplyr::count(lga) |>
add_geometry(lga, feature_type = "nswgeo.lga") |>
ggplot() +
geom_sf(aes(fill = n)) +
geom_sf(fill = NA, data = map_sf("nswgeo.lga")) +
scale_fill_viridis_b("Cases") +
theme_void()
```
## A note on resolution
Some of the source datasets are very high resolution and would make this package
too large if they were bundled. Accordingly, most data has been processed to
reduce the resolution. You can see exactly what was done by looking at the
scripts in `data-raw/`, which also help to download source data.
If you need higher resolution shapes, such as when zooming into specific postal
areas, you're better off using the original datasets directly.
## Other Australian data
* [`strayr`](https://runapp-aus.github.io/strayr/) helps with working with
data from the Australian Bureau of Statistics (ABS).
* [`absmapsdata`](https://github.com/wfmackey/absmapsdata) contains some
processed ABS geospatial data.