Documenting Drought (Beyond Reasonable Drought)

Today while riding by bike around Canberra I stopped over at the old parliament house to catchup with a friend. I was blown away by a stunning exhibition called “Beyond Reasonable Drought”. The exhibition documents in photos the effects of drought on the people, livestock and the land over the last few decades. The project looked to the Farm Security Administration (FSA) project from the great depression for inspiration. The FSA project is no doubt was one of the most impressive examples of photo-journalism.

In the Australian exhibition, as if the photos were not impressive enough upon checking out the website (http://www.oph.gov.au/brd/) for the exhibit I found all photos are geotagged.
http://tinyurl.com/drought-map-kml
http://tinyurl.com/drought-map-flickr

This information when overlaid on top of the major river basins in Australia provides an instant understanding of why the Darling/Murray basin is running out of water. If we take the clustering of the photographs as a surrogate for drought intensity then most of the photos are clustered in the southern end of the daring/murray basin in Victoria.

Google Earth
Uploaded with plasq‘s Skitch!

On a related note I just finished a project with Mikel Maron to document the growing trend in the US amongst younger people to take up farming. This aims to capture profiles of young farmers by getting them to complete a survey and provide their location. Check it out here http://www.serveyourcountryfood.net/ (it was just launched and is currently in beta)

A proud day for Australian Democracy

UPDATE: I downloaded the full postal codes listing for Australia from Australia Post’s website. I then wrote a script to geocode these postcodes by querying the Geonames postcode API. Here is a file with all the postcodes I couldn’t find in Geonames. Next I will spatially look for the electoral divisions for the postcodes I have found.

Incase you are interested here is code (a spec – don’t you love Ruby/RSpec – a specification that actually works :) )

require 'open-uri'
require 'csv'
require 'json'

class GeocodeAustralianPostcodes
  @@base_url = "http://ws.geonames.org/postalCodeSearchJSON"

  def find(postcode)
    url = @@base_url+"?postalcode=#{postcode}&maxRows=5&country=AU"
    JSON.parse(open(url).read)
  end

  def postcode_hashes(file_location)
    csv = CSV::parse(File.open(file_location, 'r') {|f| f.read })
    fields = csv.shift
    csv.collect { |record| Hash[*fields.zip(record).flatten ] }
  end

  def write(infile_location, outfile_location)
    phashes = postcode_hashes(infile_location)
    outfile = File.open(outfile_location, 'w+')
    bad_outfile = File.open('data/postcodes_notfound.csv', 'w+')
    outfile.puts("POSTCODE, LAT, LON, adminCode1, adminName1, adminName2, placeName")
    phashes.each do |h|
      response = find(h['Pcode'])
      if response["postalCodes"].empty?
        bad_outfile.puts("#{h['Pcode']} not found")
      else
        response["postalCodes"].each do |r|
          outfile.puts "#{h['Pcode']}, #{r["lat"]}, #{r["lng"]}, #{r["adminCode1"]}, #{r["adminName1"]}, #{r["adminName2"]}, #{r["placeName"]}"
        end
      end
    end
    outfile.close
  end
end

describe GeocodeAustralianPostcodes do
  before do
    @gap = GeocodeAustralianPostcodes.new
    @phashes = @gap.postcode_hashes('data/postcode_sampledata.txt')
  end
  it "should read the postcodes from the text file and convert them to an array of hashes" do
    csv_reader = CSV::Reader.parse(File.open('data/postcode_sampledata.txt', 'r'))
    csv_reader.shift
    @phashes.each do |h|
      h['Pcode'] == csv_reader.shift[0]
    end
  end
  it "should find the postcode on each line and geocode the postcode using the Geonames JSON API" do
    @phashes.each do |h|
      resp = @gap.find(h['Pcode'])
      if resp["postalCodes"].empty?
        #puts("#{h['Pcode']} not found")
      else
        resp["postalCodes"].each do |r|
          #puts "#{h['Pcode']}, #{r["lat"]}, #{r["lng"]}"
        end
      end
    end
  end
  it "should write back to an outpufile with Lat, Lon, Postcode if geocoded, othewise postcode# not found" do
    @gap.write('data/pc-full_20080529.csv', 'data/aus_post_output.csv')
  end
end

I noticed the Postcode Areas (POA) data at the ABS is missing Postcodes because they have been created by aggregating Census Districts (CDs) resulting in some postcodes dropping out because the CDs which they covered had already been allocated to other postcodes. Strange a one-to-many associations don’t seem to be supported for CDs and POA. I might need to get in touch with Australia Post to see if they have any point or polygon data for postcodes that has been mapped independent of Census Districts. Then do a join with the Electoral Divisions from the ABS. Anyone out there already done this?

Census Geographic Areas
Back in Feb at the Sydney Ruby meetup Matthew Landauer gave a talk on the Open Australia project. Today the site went live and it’s looking great! (OpenAustralia.org) The project has been developed by volunteers. You can enter your postcode, see who your local representative in parliament is, watch their activities in parliament. I love the ability to comment on each statement spoken by a parliamentarian. I actually had a very-teeny-tiny-little-bit to do with the postcode functionality. I sniffed out some of the data for postcode to commonwealth electoral division mapping. Matt informs me the first bug reports have to do with missing postcode data *blush*… yep I screwed up!… I didn’t spend enough time looking at the data before I sent it, thus overnight turning my geo-guru status in Matts eyes to a mere geo-goat!

Australian Postal code boundies
Now having a closer look at the ABS site I think I may have spotted the problem… the data for the Electoral Divisions and Postcode are not in the same hierarchy. In other words one dataset cannot be aggregated or de-aggregated to create the other. So what’s the solution? Yep the *real* geo-gurus are thinking full outer spatial-join.

Electoral Division

For the geo-goats (like me) it will help to check out this diagram that shows how Australia is chopped up into shapes by the very competent folks at the ABS.

What’s going is that the two regions are derived separately and in separate branches. I am currently looking at fixing this by getting a hold of the two data sets and freshly deriving the postcodes.

So I got the data from ABS and here are the results, looks like its as though the electoral divisions may have more than one postcode. Now to generate a new dataset… This is not a problem at the application level. The problem might occur if there is a postcode overlaps more than one electoral division … still checking the data for that

FOSS4G 2009 and the winner is … Sydney!

suits
Sydney Australia
… woohoo! its about time the FOSS4G conference came down under. So what’s gonna be so cool about it? Going by the press release the conference will have the usual suspects – the passionate community of users and developers – but some of them may be disguised in suits.

Yes you heard me SUITS!… understanding the business drivers for Geospatial Open Source is critical for greater uptake of FOSS4G in the enterprise; apart from saving thousands on license fees, better quality software and standards compliance there is now the added bonus of passion. Passion can make a huge difference to the culture of an organisation and there is no question about users of Open Source technology being passionate. If you ask a developer in your company: “please code up this application using such and such (proprietary) software” vs. “please code up this application using such and such (open source) software” then most developers are likely to be more passionate about open source than proprietary – as it gives them greater exposure and if they get to contribute a feature back to the community they get their name in the hall of fame which can lead to greater things. Even Microsoft understand this

So going by the theme of the conference User Driven FOSS4G there are likely to be managers interested in attending the conference. I should say I’m on the local organising committee and am really excited about working with the community and OSGeo to make FOSS4G 2009 worthy of its name and reputation i.e. a conference where great GeoSpatial ideas blossom and coffee flows freely. In the mean time lets make sure that FOSS4G 2008 is a success.

UPDATE: here is a an article on open source development in Australia and a list of some cool Australian’s doing open source

There’s still hope for Australia’s spatial industry

The ASIBA last week release a set of recommendations for the Australian government. These recommendations were based on a economic study evaluating what the spatial industry in Australia is worth. A staggering 6-12 billion dollars is the figure mentioned.

But lets look at the recommendations: I quite like the aims of some of these: government initiatives to commercialise OZ spatial information R&D; government policy that improves the quality, quantity, currency and accuracy of spatial data; management of digital rights and information sharing and a whole-of-government approach to licensing of geodata.

There are a number of initiatives already in the pipe-line to address some of these issues for example to address constraints on information sharing, OSDM is developing a whole-of-government approach for licensing of spatial data. There is also a push to use existing standards for discovery of spatial data where applicable such as OGC‘s CSW whose most well known implementation is FAO’s GeoNetwork. There are also projects that look to make taxpayer funding research data free. The question now is how long will it be before we start seeing the fruits of all the good intentions from the government and traditional Spatial industry. How long is a piece of string?

Meanwhile neogeography projects such as OSM continue to flourish and so do the related standards such as GeoRSS. Another recommendation that will hopefully see greater support for such open and community driven initiatives in Australia is that

… priorities are user driven, not ‘producer’ driven

Hopefully this means that the OZ government’s inacceassable silo’s of geodata that’s currently begging to be freed may one day become available in formats that ease their use online and amongst the developer community. This would no doubt lead to the emergence of new industries, a responsibility that governments have towards their nation.