Giter VIP home page Giter VIP logo

trees-api's Introduction

Trees

An API for Berlin's street trees. Based on Django and PostgreSQL/PostGIS.

Trees are extracted from Baumbestand Berlin.

Overview

Somewhat related

Roadmap / features

  • Command to import GML file
  • API endpoint to filter by properties
  • API endpoint to filter by distance from point
  • API endpoint to filter by bounding box
  • Filter combining by properties, distance from point, bounding box (Django filters, DRF-GIS)
  • Advanced filtering such as greater then year, fuzzy search on strings
  • Server-side clustering

tbc.

Set up

$ git clone https://github.com/codeforberlin/trees-api
$ cd trees
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ cp trees/settings/sample.local.py trees/settings/local.py

edit trees/settings/local.py for your database connection

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'trees',
        'USER': 'postgres',
        'PASSWORD': 'secret',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}
$ ./manage.py migrate
$ ./manage.py createsuperuser
$ ./manage.py ingest GMLFILE 2016-02-29T13:00Z
$ ./manage.py runserver

go to http://localhost:8000/admin/ or http://localhost:8000

Making Queries

REST style object retrieval

http://localhost:8000/trees/
http://localhost:8000/trees/1

Location queries

Distance to point

http://localhost:8000/trees/?dist=100&point=13.381018,52.498606

On TMS tile

http://localhost:8000/trees/?tile=15/17602/10749

In bounding box

http://localhost:8000/trees/?in_bbox=13.20,52.427,13.21,52.428

Properties

http://localhost:8000/trees/?art_dtsch=LINDE&bezirk=Spandau

trees-api's People

Contributors

jochenklar avatar johnjohndoe avatar k-nut avatar tordans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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