Posts Tagged ‘Mashup’

How Safe Is Your Suburb - Mashup entry

Friday, November 13th, 2009 by Jo Deeker

How Safe Is Your Suburb was an entry in the Mashup Australia contest.

Click here to try How Safe Is Your Suburb

How Safe Is Your Suburb is an easy-to-use interactive web application for the public to gain greater insight into crime statistics in Local Government Areas (suburbs) in New South Wales. The application can be used for informed discussion and policy development by residents, police authorities, and local government. The applicaion shows how statistics can be applied in the everyday life of the community.

How Safe Is Your Suburb embraces the Gov 2.0 philosophy by opening up a static dataset to the public in a useful way.  The user can analyse and play with the data, comment on data, and then share their data with others.

For example, the user can choose different ‘reports’, make selections within each report to compare different types of crime over time, and then see which types of crime are more prevalent in their area.  They can view an interactive thematic map of crime that provides a spatial visualisation of crime types across LGAs for a given year.  They can also identify which suburbs have higher crime rates in total and in per-head of population. (It makes sense that there is more crime in more populous areas).  Users can make comments on each visualisation they are working on.

The application mashes up NSW crime data with LGA boundary files and Census data from ABS.  Space-Time Research has classified each offence into different categories to enable simpler analysis.  More detail could be added to the application at a later date.

The application is built using Space-Time Research’s SuperVIEW product, and is hosted on the Google App Engine. In the spirit of a govhack style competition, our team of three (one database builder, one programmer, one analyst / writer) started working on the application just over 24 hours before it was due.

We would also like to share our experience of mashing up and visualising the data. We have found:

  • There is an unexpected spike in road traffic offences in 2001 and 2002 and then no road traffic offences recorded after that.  This is seen across most LGAs. Only by visualizing the data in a chart did we see the problem, and would suggest that the data quality be checked with NSW Bureau of Crime Statistics and Research before releasing this data. Perhaps the data should be footnoted.
  • We discovered gaps when joining by LGA – our map file, the ABS census data and the NSW Bureau of Crime Statistics and Research data all have slightly different datasets.  We don’t know what year the LGAs in the source data were referenced to, and our application currently joins on LGA name rather than LGA id.
  • We chose to refer to the spatial areas as ‘suburbs’ to make it easier for the general public to relate to. We are aware that LGAs are different from postcode boundaries and that the general public will not be aware of the difference between the two types of geographic boundary. Most members of the public may not know what an LGA is and we have referenced suburbs with LGA in parenthesis throughout the application.

Ideas for enhancing the application include:

  • Enhancing the share functionality by including a share this on twitter, facebook etc application.
  • Expanding the application to allow analysis by individual offence types.
  • Incorporating other ABS census demographic data, such as population count to calculate offences per head of population, and inclusion of employment, education, age breakdown etc. to see if demographics of an LGA impact crime rates.

KML Cruncher - Mashup entry

Thursday, November 12th, 2009 by Andrew Naish

The KML Cruncher was an entry in the Mashup Australia contest.

Click here to try the KML Cruncher

A utility that converts and generalizes ESRI polygon shape files into KML ready for the web. The KML Cruncher might is useful for people who want to quickly move from the shape file format into KML for web mashups.

Using the utility is easy - here’s an example of how to convert an ESRI polygon shape file to a KML file ready for the web:

Step 1 Obtain the shape file you would like to convert and save it to a local drive.

There are many example shape files at http://data.australia.gov.au.

In this example I will use the ‘Drainage Basins Queensland’ dataset available at http://data.australia.gov.au/134. Note, this utility works with polygon shape files only, so ensure you obtain a shape file that contains polygons (also referred to as ‘boundaries’). The ‘Drainage Basins Queensland’ dataset is archived in a .zip file, so make sure you extract it to your local drive before continuing.

Step 2 Now you are ready to convert your shape file.

  1. Click on the Browse button next to the ‘Choose a shape file (*.shp):’ text box.
  2. Locate and select the *.shp file from your local hard drive.

In this example I used the ‘Drainage Basins Queensland’ dataset at http://data.australia.gov.au/134, therefore I will select ‘IQATLAS.QLD_DRNBASIN_100K.shp’ file.

Step 3 Specify the dbf file.

  1. Next to the ‘Choose a dbf file (*.dbf):’ field, click on the Browse button.
  2. Locate and select the associated *.dbf file.

In this example I specified the *.dbf file that is associated with the *.shp file select in step 2, therefore I will select the ‘IQATLAS.QLD_DRNBASIN_100K.dbf’ file.

Step 4 Specify a label field. Note this field is optional.

The label field is used as an identifier for each of your converted polygons – once in KML format this is what will be shown in the information window when you click on a polygon.

This field is optional, if you do not specify it, the utility will take the first field it finds. If you would like to know what fields are available in your .dbf file you can open it using Microsoft Excel, or if you would like to inspect the data further before converting, try ESRI’s ArcExplorer product.

In this example I will set the label field to: BASIN_NAME

Step 5 Specify a generalisation tolerance.

In a nutshell the generalisation tolerance is a measurement between polygon vertices, if this tolerance is exceeded, one of the vertices will be removed. Generally you will need to specify a larger tolerance for more detailed data sets. It is likely that you will have to convert the shape file a few times to get the right tolerance, luckily I have had a bit of time to play with it, so I will specify 0.005 as the tolerance.

Step 6 Convert

  1. Click the convert button.
  2. Wait patiently and you will have a nicely generalised KML file ready to serve on the web!

Also for the developers – this is a simple HTTP post action from a WEB form (nothing fancy) therefore it could easily be used as a web service.