Download tool for AHN2 that delivers a LAZ file with the points inside a bounding box drawn by the user. Based on Flask and Openlayers 2.
MATAHN currently requires redis (http://redis.io) and postgres (http://www.postgresql.org) with postgis and the LAStools (http://rapidlasso.com/). These need to be installed first.
The recommended way to install MATAHN is using virtualenv
and pip
. Assuming you have working python (2.7) installation with these utilities, run these commands:
virtualenv venv
source venv/bin/activate
pip install git+https://github.com/tudelft3d/matahn.git
Now you need to create a MATAHN configuration file for you server:
wget https://raw.githubusercontent.com/tudelft3d/matahn/master/example_matahn.cfg
mv example_matahn.cfg matahn.cfg
edit this file to match you server setup. Then create an environment variable that points to this file:
export MATAHN_SETTINGS=/path/to/matahn.cfg
A postgresql database is required with postgis extension enabled. To create the tables required for matahn run these statements from a python shell:
from matahn.database import init_db
init_db()
In directory with laz files.
- adding gound class to filtered points (optional):
las2las -i g*.laz -set_classification 2 -olaz -odix _ground
- retrieve metadata:
lasinfo -nc -nv -nmm -otxt -i *.laz
- add index (optional):
lasindex -append -i *.laz
in python shell
from matahn.tile_io import load_tiles_into_db
load_tiles_into_db('/path/to/*.laz')
Assuming both redis and postgresql are up and running. Run these commands to quickly start MATAHN:
celery -A matahn.celery_app worker
python -c 'import matahn; matahn.app.run(use_reloader=False)'
Although for production use, you should use a proper WSGI server such as gunicorn.