GithubHelp home page GithubHelp logo

opennorth / represent-boundaries Goto Github PK

View Code? Open in Web Editor NEW

This project forked from newsapps/django-boundaryservice

26.0 26.0 15.0 693 KB

A web API to geographic boundaries loaded from shapefiles, packaged as a Django app

Home Page: https://opennorth.github.io/represent-boundaries-docs/

License: Other

Python 96.09% JavaScript 1.33% HTML 2.58%

represent-boundaries's People

Contributors

jamesturk avatar joegermuska avatar joshdata avatar jpmckinney avatar michaelmulley avatar mileswwatkins avatar onyxfish avatar palewire avatar paultag avatar shaneshifflett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

represent-boundaries's Issues

Poplus website

  • Add to http://poplus.org/components/current/
  • represent.poplus.org landing page, and docs landing page
  • Compare with MapIt generations
  • Add examples to /import step
  • Add examples to /manage step
  • Copy API docs to represent.poplus.org/docs/api/
  • Configure DNS
  • Push represent-boundaries
  • Update component_url
  • Update footers on *.popit.org
  • More images: images from represent.opennorth.ca in left column, images above each step, screenshots of websites, screenshot of demo

More robust shapefile discovery

Current quirks:

  • If a shapefile happens to have _cleaned_ in its name (and if Represent Boundaries didn't create that file), it will not be loaded.
  • If a ZIP file contains ZIP files, loadshapefiles won't decompress them, but it can handle a directory that contains ZIP files.
  • If a ZIP file contains multiple shapefiles, loadshapefiles can't handle them, but it can handle a directory that contains multiple shapefiles.
  • loadshapefiles will not recurse a directory looking for shapefiles, but it will recurse zipped directories.

As written, if extract_shapefile_from_zip were made to extract multiple shapefiles, and if two shapefiles in different parts of the zipped directory tree had the same name, it would overwrite those shapefiles. To avoid this, we need to recreate the zipped directory tree.

We should update create_data_sources and extract_shapefile_from_zip to do everything recursively and not have these quirks.

represent.opennorth.ca can't be reached

Hi @jpmckinney - I hope all is well!

It appears the service has been down (looking at client logs) today. I sent an email to peck@ and to represent@ but if there are DNS issues those may not work either. So I thought I'd try to ping you on GitHub.

I18n strings

  • apibrowser.html
  • API error messages (BadRequest, HttpResponseForbidden)
  • management command errors (ValueError), help text, log messages, print statements
  • model help text

Consider how to link to related resources

For example, a boundary detail should perhaps contain the URL of its shape resource.

And perhaps also the URL for the resource describing its representatives? In other words, this would have to be something external apps could hook in to.

Shapefile loader: split definitions across several files

The loader will walk the data/shapefiles/ directory tree and discover all files matching /.+definitions?.py$/

Those files will use a format like:

import boundaryservice

boundaryservice.register('Federal Electoral Districts',
    singular='Federal Electoral District',
    file='.', # relative to the path of the definitions file
    # etc.
)

Removing a shapefile

It seems like running python manage.py loadshapefiles --reload does not delete shapefiles that have previously been loaded. It does of course add new ones. I noticed that data/shapefiles has a remove_set.py file but it doesn't run successfully either.

Not sure if this is intentional/still needs to be built out, but wanted to point it out in case.

Update documentation

Once the experimental branch has settled a bit, documentation needs to be updated to reflect changes.

Django version requirement?

When I install represent-boundaries without specifying a Django version, I'm on 2.2.0, which does not support python manage.py syncdb --noinput. What is the most recent version of Django that is compatible with this app?

Unable to deploy on recent Heroku stacks

I'm realizing that when upgrading to recent Heroku stacks (ex heroku-22), Heroku will complain about the Python version I've been using to run our instance of the boundary service (python-3.7.5).

I tried running an upgrade locally, only to realize that upgrading causes problems with Django, where it runs from django.utils.encoding import python_2_unicode_compatible. At least according to Stack Overflow, it might be possible to either remove that line entirely, or to run pip install six and from six import python_2_unicode_compatible.

I haven't been able test this yet, I'm trying to figure out if I can revert my setup to deploy anything, but I'll test it if I can figure that part out.

Write tests

  • eliminate dumps/loads by using less strict assertion
  • Python 3 failures
  • Django 1.7 failures (app registry not ready)
  • boundary list filtering
  • loadshapefiles (can still do more)
  • compute_intersections (skipped)
  • autodiscover
  • pep8

0.4 roadmap

  • Remove throttling
  • Add start_date and end_date to BoundarySet
  • Tag and release

Add an "at" filter

An at filter to exclude boundaries whose boundary set's date range doesn't overlap with the given time.

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.