This code gives an example for obtaining colorized point cloud dataset out of two SwissTopo sources:
- SwissSurface3D: an aerial Lidar database, with the following highly accurate classification - Unclassified|Ground|Building|Vegetation|Bridges&Viaducs|Water
- SwissImage10: an orthoimage database, with 10cm resolution.
The data comes in the form of 1km² square tiles, in CH1903+ / LV95 (EPSG:2056) CRS. See linked website for full documentation.
Running unzip_and_prepare_data.py
(see below for instructions) will produce the following:
- Tiles separated into train, validation, and test sets (see
TRAIN_FRAC
andVAL_TEST_FRAC
for their size), as documented in a csv file. - Unziped point cloud with color information in
colorized/train/
,colorized/val/
, andcolorized/test/
subfolders (seeRASTER_RESOLUTION
to choose color resolution among 2m and 0.1m).
How to select data and download on SwissTopo website is explained here (EN) and [here (FR)])[https://www.swisstopo.admin.ch/fr/geodata/info.html].
Overall, the idea is to download point clouds (.las
files) in the ./data/download/las/
folder, and orthoimages (.tif
files) in the ./data/download/ortho/
.
SwissSurface3D: Selection and download page SwissImage10: Selection and download page
Select your area of interest, click on "Export all links", and save as a .csv
file with a meaningful name (e.g. DATE_AREA_SwissIMAGE10cm_Links_LV95.csv
for orthoimages and DATE_AREA_SwissSURFACE3D_Links_LV95.csv
).
Such files for the area of Lausanne are given under ./download_links/20220110_Lausanne
as an example.
Assumptions of filename convention:
- Download point cloud are expected to have filename format
swisssurface3d_YEAR_{X}-{Y}_2056_5728.las.zip
- Downloaded orthoimages rasters are expected to have filename format
swissimage-dop10_YEAR_{X}-{Y}_0.1_2056
XY pairs will be used to match point clouds with orthoimages and are expected to be unique.
wget --directory-prefix=./download/orthos/ --input-file=DATE_AREA_SwissIMAGE10cm_Links_LV95.csv
wget --directory-prefix=./download/las/ --input-file=DATE_AREA_SwissSURFACE3D_Links_LV95.csv
In a virtual environment, you will need pdal
(for installation see here and here) and numpy
to be installed. Code was run using python 3.9
and PDAL 3.0.2
.
Activate the environement, then run:
python unzip_and_colorize.py
There are a few harcoded arguments you can parameter in unzip_and_prepare_data.py
.