An open API service indexing awesome lists of open source software.

https://github.com/mdsumner/ozmaps.data

data for ozmaps
https://github.com/mdsumner/ozmaps.data

Last synced: about 1 year ago
JSON representation

data for ozmaps

Awesome Lists containing this project

README

          

---
output: github_document
editor_options:
chunk_output_type: console
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ozmaps.data

NOTE: this is a *raw data package*, it is used to help create the [ozmaps package](https://github.com/mdsumner/ozmaps), which may be more suitable for your mapping needs.

The goal of ozmaps.data is to provide reasonably detailed data sets for various spatial subdivisions of Australia.

## Installation

The package is not on CRAN but you can install ozmaps.data with:

``` r
devtools::install_github("mdsumner/ozmaps.data")
```

## Example

Here we plot each available data set with a few variations using various packages.

```{r plots}
LCC <- "+proj=lcc +lon_0=130 +lat_0=-20 +lat_1=-43 +lat_2=-10 +datum=WGS84"

library(ozmaps.data)
library(sf)
library(ggplot2)
plot(abs_ced, main = "Commonwealth Electoral Divisions")
plot(st_transform(abs_gccsa, LCC), main = "Greater Capital City Statistical Areas", graticule = TRUE)
ggplot(abs_ireg, aes(fill = NAME)) + geom_sf() + guides(fill = FALSE) + coord_sf(crs = 3577) + ggtitle("Indigenous Regions (EPSG:3577)")

## tmap with localized Local Government Area plus inset map for the state
library(tmap)
kbb <- st_bbox(dplyr::filter(abs_lga, stringr::str_detect(NAME, "Kingborough")))
k_lga <- abs_lga[unlist(st_intersects(st_as_sfc(kbb), abs_lga)), ]

kmap <- tm_shape(k_lga, bbox = kbb) +
tm_polygons(col = "NAME")

library(grid)
kmap
tasmap <- tm_shape(abs_ste %>% dplyr::filter(NAME == "Tasmania")) +
tm_polygons(col = "NAME", legend.show = FALSE)
kregion <- tm_shape(st_as_sfc(kbb)) +
tm_borders(lwd = 1)

print(tasmap + kregion, vp = viewport(0.85, 0.27, width = 0.3, height = 0.5))

plot(abs_ra, main = "Regional Areas")

plot(st_transform(abs_sa2, 3112), main = 'abs_sa2', graticule = TRUE)
plot(st_transform(abs_sa3, 28354), main = 'abs_sa3', graticule = TRUE)
plot(st_transform(abs_sa4, 28348), main = 'abs_sa4', graticule = TRUE)
plot(st_transform(abs_sed, 3111), main = 'abs_sed', graticule = TRUE)
plot(st_transform(abs_ste, "+proj=gnom +lon_0=160 +lat_0=0 +datum=WGS84"), main = 'abs_ste', graticule = TRUE)

```

Please note that the 'ozmaps.data' project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.