follow these instructions if you want to run the code locally, for running all commands from a docker container see below
Install requiremnts
python3 -m pip install -r requirements.txt
To get started download and extract the citygml dataset:
./download_gml.sh
after this all xml files should be in ./data/LoD2-DE_HH_2023-04-01
run the conversion script to get geojson files for each surface type in folder ./data/out
python3 src/main.py convert -d ./data/LoD2-DE_HH_2023-04-01 -o ./data/out
create a new sqlite Database from all geosjon files
python3 src/main.py createdb -p ./data/out/ -d ./data/out/features.db
start server with a geojson features endpoint:
python3 src/main.py serve -d ./data/out/features.db -p 5000
with running server features can be queried from the endpoint:
curl "http://localhost:5000/features" > /tmp/out.json
curl "http://localhost:5000/features?&surface_type=ground" > /tmp/out.json
curl "http://localhost:5000/features?&surface_type=ground&limit=1000&startindex=1000" > /tmp/out.json
curl "http://localhost:5000/features?bbox=9.966831,53.561622,10.057812,53.611146&surface_type=ground&limit=100" > /tmp/out.json
curl "http://localhost:5000/features?bbox=10.004725,53.577933,10.016119,53.583576&surface_type=ground&limit=10000&intersect=true" > /tmp/out.json
curl "http://localhost:5000/features?&properties=id,lage" > /tmp/out.json
api doc (swagger) can be found under http://localhost:5000
Install requiremnts
python3 -m pip install -r requirements_test.txt
Then run all test:
cd tests
pytest
docker build -t cut .
use all comannds like above but with src/run.py
which passed all arguments to the correct docker command, e.g.
python src/run.py serve