• Stars
    star
    113
  • Rank 308,489 (Top 7 %)
  • Language
    Python
  • Created about 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A spatial API for your GitHub-hosted GeoJSON

GitSpatial

A spatial API for your GitHub-hosted GeoJSON.

Read more in a blog post.

Overview

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

  1. Visit http://gitspatial.com
  2. Authorize the site to access your GitHub repos
  3. Sync the repos that have GeoJSON in them
  4. Sync individual GeoJSON files within these repos
  5. We add a post-receive hook to your GitHub repo so we get notified when you might have updated features
  6. Utilize the API to query your features

Search by Bounding Box

Find all parks within a map view:

http://gitspatial.com/api/v1/JasonSanford/mecklenburg-gis-opendata/parks?bbox=-81.025,35.023,-80.685,35.487

Search by Point and Radius

Find all parks within 3000 meters of a point:

http://gitspatial.com/api/v1/JasonSanford/mecklenburg-gis-opendata/parks?lat=35.255&lon=-80.855&distance=3000

Development

GitSpatial is a Django app that uses PostGIS as a backend to GeoDjango. So, you might run into trouble getting dependencies installed.

Non-Python dependencies

  • GEOS
  • GDAL
  • Proj

Virtual Environment

Create a virtual environment. I drop the virtual envrionment within the root of the project. The venv directory is in .gitignore.

virtualenv venv

Source to the virtual environment.

source venv/bin/activate

Install dependencies defined in requirements.txt.

pip install -r requirements.txt

Environment Variables

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

Database Stuff

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 Foreman.

foreman start

Static Files

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

Testing

Do it with fab

fab test

Deploying

Do it with fab

fab deploy

More Repositories

1

geojson-google-maps

A simple utility to convert GeoJSON objects to Google Maps vector objects (Marker, Polyline, Polygon)
JavaScript
325
star
2

leaflet-vector-layers

A little help to viewing ArcGIS Server, Geocommons, Arc2Earth, CartoDB, GIS Cloud, etc. vector data in a Leaflet map
JavaScript
217
star
3

geojsonlint.com

A simple Django app to validate your GeoJSON
Python
117
star
4

google-vector-layers

A little help to viewing ArcGIS Server, Geocommons, Arc2Earth, CartoDB, GIS Cloud, etc. vector data in Google Maps
JavaScript
67
star
5

tileify-ags-proxy

Fetch slippy map tiles from ArcGIS Server
HTML
35
star
6

tilescraping

A guide for scraping map tiles on the web
26
star
7

shapefile-ags

CLI to scrape ArcGIS Server instances and export as shapefiles
JavaScript
24
star
8

denver-bike-routes

A collaborative list of Denver bike routes
CSS
16
star
9

ags-stream

Stream features from an ArcGIS Server instance
JavaScript
14
star
10

tileify-ags

The core package that powers the Tileify AGS proxy
JavaScript
10
star
11

tileify-wms-proxy

Fetch slippy map tiles from a WMS map service
HTML
10
star
12

mapmyfitness-python

A Python wrapper for the MapMyFitness API
Python
9
star
13

tileify-wms

Fetch slippy map tiles from a WMS map service
JavaScript
6
star
14

weathered

A JavaScript wrapper for the National Weather Service API
TypeScript
6
star
15

mbtileify

Create an MBTiles set from any web map tileset
JavaScript
5
star
16

colorado-osm

GeoJSON representations of Colorado OSM data
Shell
5
star
17

denver-art

Denver Art Finder
JavaScript
4
star
18

foss4g-map

A map of things at FOSS4G 2014
JavaScript
4
star
19

rogen

Create and read fulcrum records with minimal configuration
JavaScript
4
star
20

fulcrum-arcgis-server-sync

Sync Fulcrum and ArcGIS Server using Webhooks
JavaScript
3
star
21

st-pete-map

A map of things around St. Petersburg
JavaScript
3
star
22

osm-background-tiles

A collection of custom background tiles for editing OpenStreetMap
3
star
23

wallpaper-me

A map wallpaper generating app written in React and Node.
JavaScript
3
star
24

every-mile

TypeScript
3
star
25

fulcrum-shares-demo

A simple app showing how to use Fulcrum Data Shares
JavaScript
3
star
26

weather-tab

A Chrome extension to show your current location and weather in new tabs
JavaScript
2
star
27

foss4g-na-map

A map of things at FOSS4G North America 2015
JavaScript
2
star
28

fitviz

Visualize your Strava and Under Armour workouts
JavaScript
2
star
29

open-data-day-hack

My Open Data Day hack
JavaScript
2
star
30

mtb-trails

Charlotte Mountain Bike Trails
Shell
2
star
31

arcgis-feature-matrix

A feature matrix so big you need a slippy map to view it
JavaScript
2
star
32

fulcrum-inventory

CoffeeScript
1
star
33

wallpapers

JavaScript
1
star
34

covidication

Get daily notifications (via Pushover) for Coronavirus counts for specific counties
TypeScript
1
star
35

fitmarkers

A developer challenge using the MapMyFitness API
JavaScript
1
star
36

the-long-dark-map

A web map for The Long Dark
HTML
1
star
37

mtb-trail-status

A mountain bike trail status site and notification service for Charlotte, NC
Ruby
1
star
38

webhook-tester

A simple node web server to print webhook requests to the console for easier debugging.
JavaScript
1
star
39

fulcrum-mapbox-dataset

Import all records in a Fulcrum form into a Mapbox Dataset.
JavaScript
1
star
40

native-stylist

TypeScript
1
star
41

gitspatial-presentation

I got suckered into giving a talk about a thing I built
JavaScript
1
star