Make apps4halifax – Intro
Residents can submit ideas or code apps using the HRM Open Data catalog. The best submissions may win cash prizes and awards.
The currently available data-sets include Crime occurrences, Building types, Buildings, Bus Routes, Bus Stops, Bylaw Areas, Civic Addresses, Community Boundaries, Park Recreation Features, Parks, Polling Districts, Streets, Trails, Transit Times, Waste collections and Zoning Boundaries.
You can construct web service query URLs like this:
- RESOURCE-ID identifies the data-set, see below how to determine it.
- FORMAT can be any of the supported response formats like json, xml, csv.
- PARAMS have to be valid SODA 2.0 query parameters.
You can determine the RESOURCE-ID for a dataset like this:
- Go to https://www.halifaxopendata.ca/
- Click on a dataset name
- Click the “Export” button
- Under “Download As”, copy one of the links, e.g. JSON
- The resource id is the part of the URL between “views/” and “/rows.json”
As an extremely useful example, you could query fun things like all HRM garbage collections occurring on Wednesdays:
As a simple and quick way to create web pages that interact with these web services you could use JQuery and its getJSON() function.
I will probably follow up with more posts on this topic soon.