Skip to content

A REST API to geographic boundaries. Part of Represent, the open database of Canadian elected representatives and electoral districts.

License

Notifications You must be signed in to change notification settings

fagan2888/represent-boundaries

 
 

Repository files navigation

Represent API: Boundaries

Represent is the open database of Canadian elected representatives and electoral districts. It provides a RESTful API to boundary, representative, and postcode resources.

This repository provides an API to geographic boundaries. It is based on the Chicago Tribune's django-boundaryservice.

The represent-canada repository provides a full sample app, and points to plugins which add representative, postcode, and map features to this boundaries API.

API documentation is available at represent.opennorth.ca/api/.

Installation

Install the package:

python setup.py install

Add boundaries to INSTALLED_APPS in your settings.py.

Add the following to your urls.py:

(r'', include('boundaries.urls')),

Run python manage.py syncdb (or migrate if you use South).

Adding data

By default, shapefiles are expected to be in subdirectories of [project_dir]/data/shapefiles, though this can be configured via the BOUNDARIES_SHAPEFILES_DIR setting.

To load data, run

python manage.py loadshapefiles

This command loads every file for which it can find a definition. It looks for definitions in files ending with definition.py or definitions.py in BOUNDARIES_SHAPEFILE_DIR or its subdirectories.

See the sample definition in definition.example.py.

Note that it's a good idea to keep DEBUG off during this process or Django will try to remember every SQL command.

API starting point

The starting point for exploring the API resources is /boundary-sets. From there you'll see references to additional URLs to look at.

Contact

Please use GitHub Issues for bug reports. You can also contact represent@opennorth.ca.

About

A REST API to geographic boundaries. Part of Represent, the open database of Canadian elected representatives and electoral districts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.3%
  • JavaScript 2.7%