Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
 
 
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ozmaps.data

NOTE: this is a raw data package, it is used to help create the ozmaps package, 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:

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

Example

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

LCC <- "+proj=lcc +lon_0=130 +lat_0=-20 +lat_1=-43 +lat_2=-10 +datum=WGS84"

library(ozmaps.data)
library(sf)
#> Linking to GEOS 3.7.0, GDAL 2.3.2, PROJ 5.2.0
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)), ]
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar

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

library(grid)
kmap 
#> Legend labels were too wide. The labels have been resized to 0.45, 0.30, 0.41, 0.53, 0.36, 0.34. Increase legend.width (argument of tm_layout) to make the legend wider and therefore the labels larger.
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. By contributing to this project, you agree to abide by its terms.

You can’t perform that action at this time.