Giter Site home page Giter Site logo

ozmaps's Introduction

Build Status Build Status AppVeyor Build Status CRAN status cranlogs Coverage Status

Overview

The goal of ozmaps is to get maps of Australia to plot!

Installation

ozmaps may be installed directly from github.

devtools::install_github("mdsumner/ozmaps")

The package includes some simple features data, which can be used independently of ozmaps with the ‘sf’ package. If required, install sf from CRAN.

install.packages("sf")

Usage

Plot Australia with states.

library(ozmaps)
ozmap()

Plot Australia without states.

ozmap(x = "country")

Add to an existing plot.

plot(quakes[c("long", "lat")], xlim = c(120, 190))
ozmap(add = TRUE)

Obtain the data used in sf form.

sf_oz <- ozmap_data("states")

tibble::as_tibble(sf_oz)
#> # A tibble: 9 x 2
#>   NAME                                                             geometry
#>   <chr>                                                  <MULTIPOLYGON [°]>
#> 1 New South Wales     (((150.7016 -35.12286, 150.6611 -35.11782, 150.6373 …
#> 2 Victoria            (((146.6196 -38.70196, 146.6721 -38.70259, 146.6744 …
#> 3 Queensland          (((148.8473 -20.3457, 148.8722 -20.37575, 148.8515 -…
#> 4 South Australia     (((137.3481 -34.48242, 137.3749 -34.46885, 137.3805 …
#> 5 Western Australia   (((126.3868 -14.01168, 126.3625 -13.98264, 126.3765 …
#> 6 Tasmania            (((147.8397 -40.29844, 147.8902 -40.30258, 147.8812 …
#> 7 Northern Territory  (((136.3669 -13.84237, 136.3339 -13.83922, 136.3532 …
#> 8 Australian Capital… (((149.2317 -35.222, 149.2346 -35.24047, 149.2716 -3…
#> 9 Other Territories   (((167.9333 -29.05421, 167.9188 -29.0344, 167.9313 -…

Plot with a custom palette.

library(sf)
nmjr <- colorRampPalette(paletteer::paletteer_d(package = "ochRe", palette = "namatjira_qual"))(nrow(sf_oz))
plot(st_geometry(sf_oz), col = nmjr)

## soon...plot directly with ggplot2
library(ggplot2)
ggplot(sf_oz, aes(fill = NAME)) + geom_sf() + coord_sf(crs = "+proj=lcc +lon_0=135 +lat_0=-30 +lat_1=-10 +lat_2=-45 +datum=WGS84") + scale_fill_manual(values = nmjr)

Plot the ABS layers (from 2016).

opal <- colorRampPalette(paletteer::paletteer_d(package = "ochRe", palette = "namatjira_qual"))
ozmap("abs_ced", col = opal(nrow(abs_ced)))

ozmap("abs_ste", col = opal(nrow(abs_ste)))


Please note that the ‘ozmaps’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ozmaps's People

Contributors

mdsumner avatar ntomasetti avatar

Stargazers

Xiangyun Huang avatar Adam Gruer avatar Garth Tarr avatar obrl_soil avatar Martin Sudmanns avatar Dan avatar  avatar Miles McBain avatar Hayley Brown avatar Adam H. Sparks avatar

Watchers

James Cloos avatar Garth Tarr avatar  avatar Stephanie Kobakian avatar

Forkers

ntomasetti

ozmaps's Issues

split out data package

I'd hoped to not have to do this, but CRAN wants packages under 5Mb unless it's a data package, and hence won't change very often and clog up the disks with archives.

  • rejig ozmaps.data to be these layers, it means that package should really use piggyback and tighten that up a lot, keep the original stuff and ship the simplified versions
  • ozmaps will be bare minimum, whatever that means - states, commonwealth electoral - probably, maybe LGA - all other layers kept external

(that means a bit of back tracking given how I first started this process)

Error: package or namespace load filed

Hi,
I have installed package 'ozmaps' and 'sf'. When i use library(sf) it automatically closes my R and restarts. and with library(ozmaps) it shows the error below:

Error: package or namespace load failed for ‘ozmaps’: .onLoad failed in loadNamespace() for 'sf', details: call: CPL_set_data_dir(prj) error: function 'Rcpp_precious_remove' not provided by package 'Rcpp'

the bowerbird "all states" effort

Here's Tasmania:

     {"name":"Tasmanian Government LIST Open Data",
      "description":"Tasmanian location based information.",
      "reference":"https://www.thelist.tas.gov.au",
      "source_urls":"http://listdata.thelist.tas.gov.au/opendata/data/",
      "citation":"",
      "license":"http://www.tas.gov.au/stds/codi.htm",
      "comment":"",
      "do_sync":true,
      "method":"wget",
      "method_flags":"--recursive --no-parent",
      "postprocess":"unzip",
      "access_function":"[various]",
      "data_group":"Local authority"
     },

state government spatial data

This has cadastre, roads, elevation contours, localities, and many others. raadfiles has some file handling https://github.com/AustralianAntarcticDivision/raadfiles/blob/3ad7065d1680715e4617c5c36a256054fb0d5888/R/raad-thelist-files.R

imagery

Can we scrape this as raster data? Is the ortho and other images available for download in whole form?

https://github.com/mdsumner/tasmapr

Lidar

Is Wellington and coastal lidar available in raw form?

first cut of maps and functions for different subsets

Steph Kobakian and Nat Tomasetti worked on the ozmaps during our numbat hackathon these last few days. They have R data files of the main ABS maps, and code to pull and generate new ones as they arise. They are thinned down to low resolution. There are functions to select regions on the maps also. All of this is at https://github.com/NTomasetti/mapsR. If you want to take it over and package nicely it would be welcome %^)

basic data layers and plotting entities

  • oz outline
  • state outlines
  • local govt areas (LGA), municipalities
  • electoral areas
  • ABS statistical areas (SA1, SA2, SA3, SA4)

For each one,

  • provide source/s that are inbuilt data sets (up to a few Mb in the package)
  • simple plot, vs get the layer
  • simplified attribute names (NAME, STATE, etc) as well as access to the raw data

Code to download a different shapefile and make available

Can you provide the code to download other shapefiles, and convert to R objects, as part of this package? The SA2, SA4, .... all change periodically, and we will need to update the maps. If we are working on some historical data, we would need to have older shapefiles converted to R object. It would be really helpful to have this code available as part of the package.

name and context

Name

  • ozmaps

I'm a bit uneasy about having "ozmaps" as the package and "ozmap" as the functions, that sometimes causes problems - but it matches maps::map nicely.

Context

  • integrate with maps package?
  • investigate similar packages

There is eechidna, oz, bomrang, grattan, Census2016, ALA4R and heims.

Who else is working on this?

Generalization

  • create sources in bowerbird form, publish those with bowerbird (but don't use bb)
  • hardcode the links for download, and point to bowerbird as an automatable set up

Do we have ozmaps, and ozmapsdata as analogous to maps/mapdata?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.