It's a dockerised version of pySunlight program.
pySunlight-docker is one repository of the Sunlight project, including :
Clone the repository.
git clone https://github.com/VCityTeam/pySunlight-docker.git
-
Copy and rename .env.example to . env.
-
Create two folders named
inputs
andoutputs
(Or wathever you chose in the .env file). Place your 3DTiles in the inputs folder (it can be in a subfolder).
As an example, 3DTiles datasets for the city of Lyon can be found on the LIRIS' website. We recommend fetching the data using ftp (or filezila for example).
The input folder should be constructed as such :
├── inputs # Or the custom name given in the .env file
├── tiles
├── tilex.b3dm
├── tiley.b3dm
├── tileset.json
- Adapt the configuration to your needs. Here is a full list of all options available :
Arguments | Description | Example |
---|---|---|
TIMESTAMP | ISO Timestamp at wich to calculate sunlight (YYYY-MM-DDTHH:00) | 2020-05-05T12:00 |
LOG_LEVEL | Provide logging level depending on logging module | DEBUG, INFO, WARNING, ERROR, CRITICAL |
INPUTS_FOLDER | Inputs folder containing 3D Tiles use for sunlight computation | ./inputs |
OUTPUTS_FOLDER | Outputs folder containing 3D Tiles with Sunlight Result in batch table | ./outputs |
FORMAT | The format with which to output the results (CSV or TILE) | CSV |
OPTIONAL_ARGS | Optional arguments (compute aggregate...) | --with-aggregate |
START_DATE | Start date of sunlight computation (Only if TIMESTAMP is not defined) | 403224 |
END_DATE | End date of sunlight computation (Only if TIMESTAMP is not defined) | 403248 |
Explanation for START_DATE and END_DATE : They are a deprecated time format, that was introduced in 3DUSE. The time is represented in Hours since 1975-01-01T00:00, so 403224 translates to 2016-01-01T00:00 in ISO time format. It is recommended that you use TIMESTAMP as the format is standardised and human readable.
The format is CSV by default and should be left as is, the 3DTIles export is broken and deprecated.
Sometimes, windows can be fussy with end of line terminators, we recommend you run the following command to prevent issues with reading the entrypoint.sh file
dos2unix Context/entrypoint.sh
-
Build pySunlight docker-compose :
docker compose build
-
Run the container with :
docker compose up
-
Build pySunlight DockerFile :
docker build -t pysunlight --file Context/Dockerfile .
-
Run dockerfile with .env file :
docker run -v ./inputs:/inputs -v ./outputs:/outputs --env-file .env pysunlight
or run docker file with arguments :
docker run -v ./inputs:/inputs -v ./outputs:/outputs -e START_DATE=403224 -e END_DATE=403248 -e LOG_LEVEL=DEBUG -e OPTIONAL_ARGS=--with-aggregate pysunlight
To visualise the CSV results please refer to this repository which contains a POC of a visualisation.