The Boundary Mapper’s Cookbook

Dots on maps don’t always tell you the full story behind the numbers.  In cases where you’ve got postcode, suburb or council based data – you’ll want to be able to map those boundaries to tell a richer story than text, numbers or dots can do.

Here’s a quick and dirty guide to getting up and running with boundary data just in time for GovHack:

1 – Install PostgreSQL 9.1 : http://www.enterprisedb.com/products-services-training/pgdownload

2 – Install PostGIS 2.0 : http://www.postgis.org/download/  (there are now 64bit binaries for those who want serious spatial power)

3 – Download some Shapefile (SHP) formatted boundary data and load it into PostGIS (there’s a GUI – PostGIS Shapefile and DBF Loader 2.0 – inside the PostgreSQL Admin Console).  If you’ve got another format there are OS tools you can use – try OGR2OGR (handy guide here)

4 – Download some data to go with those lovely boundaries – e.g. some juicy hot off the press ATO Tax data

5 – Install PHP 5.3 on your web server with the PostgreSQL PDO drivers : http://php.net/downloads.php

6 – Download the PostGIS RESTful Web Service Framework 1.1 (PRWSF)

7 – Edit the PRWSF /inc/database.inc.php file to set your PostgreSQL database connection

8 – Download Leaflet Javascript API

9 – Get a Cloudmade account for a free API key to access to an OpenStreetMap tile layer of your choice

10 – Edit the PRWSF /v1/ws_geo_attributequery.php file to support callbacks for cross domain JSON:

     echo $_GET['jsoncallback'] . ‘(‘;

                require_once(“../inc/format.inc.php”);

    echo ‘)’;

11 – Leech some code from GitHub

FYI – the ABS has a rich collection of boundaries for you to use under Creative Commons licensing.  This links directly to their own stats as well as the stats of many other agencies and organisation, such as the ATO (who recently released a tonne of tax data!).  This data is ripe for rich visualisation:

http://www.abs.gov.au/websitedbs/D3310114.nsf/home/ABS+Geography+Publications#Anchor8

Note: 2006 Census data uses he ASGC boundaries.  2011 Census data will use the ASGS bdys when the data is released on June 21.

LeafletTest

Here’s one I prepared earlier…


2 Comments on “The Boundary Mapper’s Cookbook”

  1. You can save yourself some work if you use my asgs2pgsql loader or db dump. It contains all the ASGS_2011 structures (abs regions, states, postal areas, suburbs, commonwealth and state electoral divisions, lga’s, etc.)

    https://github.com/andrewharvey/asgs2pgsql


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 674 other followers