Skip to content

VCityTeam/py3dtilers-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

Dockerized py3dtilers application

Building and running a py3dtilers application (with docker)

This container wraps p3dtilers (a Python tool and library).

Build the docker image without cloning this repository with

docker build -t vcity/py3dtilers https://github.com/VCityTeam/py3dtilers-docker.git -f Context/Dockerfile

Or you can clone this repository and then proceed with the building with

git clone https://github.com/VCityTeam/py3dtilers-docker.git
docker build -t vcity/py3dtilers Context

Then run the container e.g. with

docker run --rm -t vcity/py3dtilers geojson-tiler --help
docker run --rm -t vcity/py3dtilers citygml-tiler --help

Usage example : GeoJson : 3D Tiles colored by height

Download the GeoJSON file available here.

docker run --rm -v <absolute/path/to/folder>:/mnt/data/ -t vcity/py3dtilers geojson-tiler --path /mnt/data/buildings_lyon1.geojson --add_color HAUTEUR -o /mnt/data/buildings_colored_by_height

Where <absolute/path/to/folder> is the absolute path to the folder containing the GeoJSON file.

The tileset will be created in a folder named <absolute/path/to/folder>/buildings_colored_by_height.

Usage example: running the citygml-tiler (with docker)

Running the citygml tiler of py3dtilers requires a 3DCity database loaded with imported citygml content. The following set of commands (requiring a functionnal docker client illustrates a full citygml tiling process realized from the CLI:

1. Start a 3DCity database

References:

docker network create citydb-net
docker run --rm -d --name 3dcitydb --network citydb-net -p 5432:5432 \
    -e POSTGRES_PASSWORD=my_dummy_password \
    -e SRID=3946 \
    -e HEIGHT_EPSG=espg:3946 \
    -e POSTGRES_DB=my_3dcitydb \
    -e POSTGRES_USER=my_postgres \
    -e POSTGIS_SFCGAL=true \
  3dcitydb/3dcitydb-pg:14-3.2-4.2.0
PGPASSWORD=my_dummy_password psql -h localhost -p 5432 -U my_postgres -d my_3dcitydb -c "\dt"

2. Download CityGML files and import them to 3DCity database

References:

Download CityGML data to your local filesystem e.g.

wget https://download.data.grandlyon.com/files/grandlyon/imagerie/2018/maquette/LYON_1ER_2018.zip
unzip LYON_1ER_2018.zip
rm -f LYON_1ER_2018.zip

Import local CityGML files to 3DCity database

docker run --rm --network citydb-net --name 3dcitydb-impexp \
    -v $(pwd):/data \
    3dcitydb/impexp:5.0.0 import \
    -H 3dcitydb -d my_3dcitydb -u my_postgres -p my_dummy_password \
    LYON_1ER_2018/*.gml

3. Run the citygml tiler of py3dtilers

Create py3dTilers configuration file describing access to 3dCityDB occurence

echo "PG_HOST: 3dcitydb"               > Config.yml
echo "PG_PORT: 5432"                  >> Config.yml
echo "PG_NAME: my_3dcitydb"           >> Config.yml
echo "PG_USER: my_postgres"           >> Config.yml
echo "PG_PASSWORD: my_dummy_password" >> Config.yml

Build the CityTiler and run it against current state of 3dCityDB occurence

git clone [email protected]:VCityTeam/py3dtilers-docker.git
docker build -t vcity/py3dtilers py3dtilers-docker/Context
docker run --rm --network citydb-net -v $(pwd):/data -t vcity/py3dtilers citygml-tiler --db_config_path /data/Config.yml

Known problems

Build fails on macOS/Silicon

On macOS 14.5 (Sonoma) with an M3 Pro (Silicon series) chip, the docker build command

docker build -t vcity/py3dtilers https://github.com/VCityTeam/py3dtilers-docker.git -f Context/Dockerfile

will fail on the pip install command that triggers an error of the form

Could not find a version that satisfies the requirement ifcopenshell (from py3dtilers)`.

A workaround consists in cross building for x86 with the following docker build command

docker buildx build --platform linux/amd64 -t vcity/py3dtilers https://github.com/VCityTeam/py3dtilers-docker.git -f Context/Dockerfile

About

Docker wrappings of the py3DTilers tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published