Git Product home page Git Product logo

represent-boundaries's Introduction

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 [email protected].

represent-boundaries's People

Contributors

joegermuska avatar joshdata avatar michaelmulley avatar onyxfish avatar palewire avatar shaneshifflett avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.