The potree python server application | Read-only mirror of https://github.com/sitn/pytree — Canton de Neuchâtel. Issues & pull requests at the source.
  • Python 56.8%
  • HTML 20.6%
  • Dockerfile 17.2%
  • Shell 5.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Stéphane Malta e Sousa 408aee202d
Update README.md
2023-11-20 10:28:56 +01:00
bin/licenses build failing 2022-11-30 12:10:21 +01:00
pytree remove pytree.yml from image 2022-12-01 16:56:18 +01:00
.dockerignore remove pytree.yml from image 2022-12-01 16:56:18 +01:00
.env.sample Make port correspond to docker-compose.yml and README 2021-01-22 16:51:18 +01:00
.gitattributes Merge branch 'main' of https://github.com/sitn/pytree into main 2022-11-08 13:35:02 +01:00
.gitignore Update gitignore 2020-12-14 12:32:05 +00:00
devserver.py Fix bind hostname 2020-12-08 16:40:43 +00:00
docker-compose.yml remove pytree.yml from image 2022-12-01 16:56:18 +01:00
Dockerfile finalize multistage build 2022-11-30 17:55:20 +01:00
example_config.yml simplify config for miulti dir 2022-06-02 15:29:48 +02:00
gunicorn_config.py deep refactor, move to docker 2020-10-30 12:14:58 +01:00
README.md Update README.md 2023-11-20 10:28:56 +01:00
requirements.txt escape params 2022-11-09 08:47:41 +01:00
setup.py deep refactor, move to docker 2020-10-30 12:14:58 +01:00
start_server.sh Rename init script 2020-12-21 10:09:12 +00:00
wsgi.py deep refactor, move to docker 2020-10-30 12:14:58 +01:00

Pytree

A containerized Flask application serving potree to extract height profile from LiDAR data.

Credit goes to M. Schuetz for the development of CPotree.

Requirements

You will need docker and docker-compose to run the application.

Context of pytree

Diagramme sans nom drawio(8)

Installation

Clone this repository on your machine.

Then, create your .env file with a DEPLOY_ENV variable set to either DEV or PROD, a PORT variable specify which port of your host machine you want to use, and a DATA_DIR variable containing the absolute path to the directory containing your metadata.json file for your Potree LiDAR tiles (generated using PotreeConvert v2.x.x). Check .env.sample for inspiration.

Thirdly, copy example_config.yml to pytree.yml and make sure to adapt the variable to your environment. Especially adapt the following four variables:

  • cpotree_executable
  • pointclouds
  • default_point_cloud

Finally run the 2 following commands:

docker-compose down --remove-orphans -v
docker-compose up

Update CPotree

In order to update to the last version of CPotree, you'll need to compile the new version. This is possible by building a new pytree image: docker build -t sitn/pytree:<tag_version> .

Replace <tag_version> by whatever version you want and if it's working you can push it to docker hub and update the docker-compose.yml accordingly (image with new tag you just created).

Using Windows WSL

The first time you use your Debian WSL distro:

sudo apt-get update
sudo apt-get install docker.io

Then, you will have to mount your share where metadata.json can be found. To do so, edit the fstab file:

sudo vi /etc/fstab

And add your Window share. this might look like something:

//windows_share/pointclouds                 /mnt/pointclouds  cifs    user=windows_username,password=windows_password               0       0

Then, in your mnt folder, create a pointcloud folder:

sudo mkdir pointcloud
sudo mount -a

From one time to the other, you might have to rerun sudo mount -a in order to mount the share.

All Docker cmd have to be run in sudo mode.

Usage

The application runs at http://localhost:6001/pytree

Please chek https://github.com/potree/CPotree/blob/master/README.md for a comprehensive list of valid URL parameters to get a LiDAR profile.

You can also start a shell to further explore inside the running container and play around with the executable:

docker exec -it pytree_api_1 bash

Then execute extract_profile:

extract_profile data/processed/metadata.json -o "stdout" --coordinates "{2525528.12,1185781.87},{2525989.37,1185541.87}" --width 10 --min-level 0 --max-level 5 > data/output/test.las