Giter Club home page Giter Club logo

psma-admin-bdys-data's Introduction

psma-admin-bdys-data

A UNIX pipeline to automate working with PSMA Administrative Boundaries data.

  • Downloads data from data.gov.au
  • Join attributes to geometry (they are separate in upstream)
  • Merge states into a single countrywide dataset
  • Optionally load into PostgreSQL/PostGIS

Processed outputs can be downloaded from https://tianjara.net/data/psma-admin-bdys/.

Install Dependencies

On Ubuntu/Debian run:

apt-get install wget unzip parallel jq gdal-bin

Usage

All data

To run all steps on all data:

make

Single dataset

To only download a single dataset:

make FILE="documents.zip" download_single

See whitelist.txt for a list of datasets.

Then unpack and process with:

make unpack process

PostgreSQL/PostGIS

To load the processed Shapefile(s) into PostgreSQL/PostGIS, set the PG environment variables and run:

make pgsql

or individually with:

shp2pgsql -dI data/outputs/shp/FILENAME.shp TABLE_NAME | psql

Make Targets

These make targets are run as part of make, this documents what they do.

  • data/index.json: Download a machine readable index of all resources available at https://data.gov.au/dataset/psma-administrative-boundaries into data/index.json
  • download_all: Download all PSMA Administrative Boundaries datasets into data/resources
  • download_single: Download a single named dataset into data/resources
  • unpack: Unzips all downloaded datasets into data/resources_unzip
  • process: The source datasets are split into per state files with geometry and attributes in separate files. This stage combines all states together into an Australia wide file and joins all attributes. Outputs to data/outputs/shp
  • pack: Creates .tar.xz (defaults to .tar.xz, call ./src/pack.sh zip directly for .zip) files of the data/outputs/shp files for easy distribution into data/outputs/xz (or data/outputs/zip)
  • clean: Removes data/index.json only
  • clean_all: Removes all downloaded and processed data
  • pgsql: Load Shapefiles into PostgreSQL/PostGIS

License

Code licensed under the ISC license per LICENSE.

Administrative Boundaries ©PSMA Australia Limited licensed by the Commonwealth of Australia under Creative Commons Attribution 4.0 International licence (CC BY 4.0).

See also

psma-admin-bdys-data's People

Contributors

andrewharvey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

psma-admin-bdys-data's Issues

load to psql

  • automatically determine table name from filepath
  • load into schema with psql setup -> via env variables

todo

  • migrate to gitlab with automated CI builds and deploy
  • toMBTiles
  • mesh borders

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.