An API for Berlin's street trees. Based on Django and PostgreSQL/PostGIS.
Trees are extracted from Baumbestand Berlin.
- Data source: Baumbestand Berlin
- Data extraction via codeforberlin/wfs-downloader
- This is the API
- Map for trees.codefor.de via codeforberlin/trees-map
- The map tiles and also the tree tiles are generated using codeforberlin/trees-mapnik
- codeforberlin/treemeta collects botanical names which might be integrated in the API or by a client application.
- codeforberlin/tree-column-names is not directly used in this project but the basis for the column-names.json that is used.
- 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.
$ 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
http://localhost:8000/trees/
http://localhost:8000/trees/1
http://localhost:8000/trees/?dist=100&point=13.381018,52.498606
http://localhost:8000/trees/?tile=15/17602/10749
http://localhost:8000/trees/?in_bbox=13.20,52.427,13.21,52.428
http://localhost:8000/trees/?art_dtsch=LINDE&bezirk=Spandau