A spatial API for your GitHub-hosted GeoJSON.
Read more in a blog post.
GitHub now supports rendering GeoJSON files. This makes it easy to collaborate on geo data. GitSpatial provides a spatial API for GeoJSON hosted at GitHub.
How it Works
- Visit http://gitspatial.com
- Authorize the site to access your GitHub repos
- Sync the repos that have GeoJSON in them
- Sync individual GeoJSON files within these repos
- We add a post-receive hook to your GitHub repo so we get notified when you might have updated features
- Utilize the API to query your features
Search by Bounding Box
Find all parks within a map view:
Search by Point and Radius
Find all parks within 3000 meters of a point:
GitSpatial is a Django app that uses PostGIS as a backend to GeoDjango. So, you might run into trouble getting dependencies installed.
Create a virtual environment. I drop the virtual envrionment within the root of the project. The
venv directory is in
Source to the virtual environment.
Install dependencies defined in
pip install -r requirements.txt
To keep secret keys, passwords and such out of version control, we store them in environment variables. Below are the variables required to run.
AWS_ACCESS_KEY_ID=my-aws-key AWS_SECRET_ACCESS_KEY=super-secret-aws-secret-access-key DATABASE_URL=postgis://user:password@host:port/db_name GITHUB_APP_ID=not-a-secret GITHUB_API_SECRET=super-secret
Assuming you have a database already created and credentials are in the
DATABASE_URL envrionment variable, we just need to
syncdb to get the necessary tables created. Do not create a superuser if prompted.
python manage.py syncdb
Running the App
The django web server (gunicorn) and the celery process are defined in
Procfile. Run with
Static file deployment is handled by the
collectstatic command. We're using a combination of django-store and boto to automatically collect/push static files to Amazon S3 during deployment.
All static files should be placed in the
/static directory if they need to be deployed.
python manage.py collectstatic
Do it with fab
Do it with fab