Coder Social home page Coder Social logo

boundaries's Introduction

Django Boundary Service for INN projects

This repository uses Django Boundary Service with shapefiles used in INN projects.

Getting started

Clone the repository:

git clone [email protected]:INN/boundaries.git
cd boundaries

Create a virtualenv:

mkvirtualenv boundaries

Make sure you have libevent installed:

brew update
brew install libevent

Make sure you have GDAL installed:

brew update
brew install gdal

See "Compatibility hack for newer versions of GDAL" in the notes at the bottom of this guide if you receive a "Could not parse version info string" error.

Install requirements:

workon boundaries
pip install -r requirements.txt

Install postgresql:

brew update
brew install postgresql

Run postgresql:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

Run the included drop_create_db.sh script:

./drop_create_db.sh

Run the development server:

./manage.py runserver

Visit the dev site to verify it is working:

http://localhost:8000/1.0/boundary/

Notes:

Stopping postgresql

To stop postgresql, run:

pg_ctl -D /usr/local/var/postgres stop -s -m fast

Compatibility hack for newer versions of GDAL

It may be necessary to modify line 120 of Django's /path/to/your/virtualenv/site-packages/django/contrib/gis/geos/libgeos.py file to work properly with newer versions of GDAL.

If you see receive a "Could not parse version info string" error, try changing that line to:

ver = geos_version().decode().split(' ')[0]

Be sure and change "/path/to/your/virtualenv/" in the file path to an actual file path on your machine.

Compile error when pip install -r requirements.txt

If you have already done brew install libevent but it's complaining about event.h, try this instead:

CFLAGS="-I /usr/local/Cellar/libevent/2.1.8/include -L /usr/local/Cellar/libevent/2.1.8/lib" pip install -r requirements.txt

This tells the compiler where libevent is. TO find the correct paths, use brew info libevent

Wrong version of libevent

gevent/core.c:2750:47: error: no member named 'ev_flags' in 'struct event'

If your pip install -r requirements.txt includes an error like that, run brew info libevent:

$ brew info libevent
libevent: stable 2.1.8 (bottled)
Asynchronous event library
http://libevent.org
Conflicts with:
  pincaster (because both install `event_rpcgen.py` binaries)
/usr/local/Cellar/libevent/2.1.8 (847 files, 2.2MB) *
  Poured from bottle on 2017-05-31 at 16:46:47
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libevent.rb
==> Dependencies
Build: autoconf ✔, automake ✔, doxygen ✘, libtool ✔, pkg-config ✔
Required: openssl ✔
(inn-boundaries)blk@oyster:~/software/boundaries$ 

Looks like this version of gevent only works with libevent version 2.0.x

Brew doesn't provide a way to choose an outdated version of the formula; good luck installing it by hand from http://libevent.org/

boundaries's People

Contributors

rnagle avatar benlk 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.