66 :: Building a map out of Open Data

Documenting my work in progress.

ODWE runs on the CKAN platform which provides an API that’s described here.

So, let’s test it out (the dataset involved is temporary and so these links will eventually break)

1. Get a package list from ODWE : http://www.odwe.ca/api/3/action/package_list

2. Get a full JSON representation of a dataset: http://www.odwe.ca/api/3/action/package_show?id=ford-city-asset-map-draft

But how do get moar?  Get Resource Show sounds promising. But it looks like we can form a simple HTTP request for the data. It looks like we might have to use Python.

src/c/k/ckanext-ecportal-HEAD/ckanext/ecportal/logic.py   ckanext-ecportal(Download)

401
402
403
404
405
def resource_show(context, data_dict):
    resource = logic.action.get.resource_show(context, data_dict)
    _change_resource_details(resource)
    return resource
 

Ok. So now to write the code!

Addendum:

Getting data out is much easier than I thought. I looked through some of the in-context help and there are some lovely examples build queries from!

query-examples

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *