AHN pointcloud viewer web service
Web service for the ahn-pointcloud-viewer web application. Ahn-point-cloud-viewer is a point cloud visualization for country sized point clouds.
The web service has the following api endpoints:
- Compute the number of points in a selected area
- Create a laz file of the selection and send a mail to an end-user with download location of the generated laz file
It uses a PostGIS database to approximate number of points in selected area.
git clone email@example.com:NLeSC/ahn-pointcloud-viewer-ws.git ./gradlew build
The distribution is in the
- Unpack distribution and cd to it.
- Create config file, use
config.yml-distas an example.
- Run it
bin/ahn-pointcloud-viewer-ws server config.yml
A web service will be started on http://localhost:8080
To open in an IDE like Eclipse or Intellij IDEA, create project files with
./gradlew eclipse or
./gradlew idea respectively.
Perform tests with test and coverage reports in
./gradlew test jacocoTestReport
First create config file
config.yml-dist as an example.
- Create a database.
1.1 Start db
docker run -e POSTGRES_USER=ahn -e POSTGRES_PASSWORD=mysecret -p 5432:5432 -d mdillon/postgis
1.2 Fill it with test dataset
psql -h localhost -p 5432 -U ahn ahn < src/test/resources/test.sql
- Create a debug executable to run to create laz files. For example:
#!/bin/bash echo `date -Iseconds`: $@ >> ahn-slicer.log
config.ymlto set database and executable
- Start web service with
- Test with a http client
virtualenv env . env/bin/activate pip install httpie http -pHBhb http://localhost:8080/size left:=125932.60 bottom:=483568.840 right:=125942.60 top:=483588.840 http -pHBhb http://localhost:8080/laz left:=125932.60 bottom:=483568.840 right:=125942.60 top:=483588.840 firstname.lastname@example.org
Api spec and documentation
The web service uses Swagger specification to describe it's endpoints.
The running web service will have the Swagger UI at
/swagger and the Swagger spec at
The Swagger specification is available as
./swagger.yaml in this repo. It can be viewed in the swagger UI.
Database and create_user_file
This web service relies on a database which contains
- a table with the extents of the files in the AHN2,
- a table with the extents of the files in the octree structure and
- a third table that contains, for each level of the octree, the ratio of points in the level divide by the total number of points .
To fill in a PostgreSQL database with the required information use the scripts
fill_db_potree.py from the
src/main/python is used to create a user file
from a selected region and it uses the described PostgreSQL database. The scripts uses LAStools.