Welcome to the official code repository for the swisstopo / FOEN www.rapidmapping.admin.ch initiative. This repository contains software and code developed by swisstopo, a Swiss government agency, dedicated to the timely acquisition and provision of geospatial data in the event of natural disasters. Our Rapidmapping service is a crucial tool in delivering aerial or satellite imagery to support disaster response and management.
Rapidmapping is a federal service aimed at swiftly gathering and distributing geospatial data, such as aerial or satellite images, during natural events. This repository encompasses various scripts, utilities, and resources that facilitate the creation and dissemination of these rapid mapping products.
- Data Processing Pipelines: Scripts to handle image preprocessing, analysis, and conversion.
- Data Publication Pipelines: Tools to ensure quick publication of mapping products.
Detailed usage instructions for each tool and script can be found in their respective directories.
We provide several utility scripts to assist with various tasks in the utilities:
This script processes images for the RM-PublishEinzelbilder project. It includes functions for resizing images, extracting EXIF data, and generating KML and TXT files. The intention was to run this script as an intermediate solution on a laptop with QGIS and therefore OSGeo4W Shell, without requiring additional Python packages, so it can be run on a PC with a standard QGIS installation.
- Image Resizing: Efficiently generates thumbnails images .
- EXIF Data Extraction: Check and extract metadata from images for further processing.
- KML File Generation: Create KML files for easy visualization of geospatial data.
- TXT File Generation: Produce TXT files for downloadlinks.
To use this script, run the following command in your OSGeo4W Shell with a standard QGIS installation:
python rm-publish_einzelbilder.py
This script removes the empty TIFs (TIFs with only "no data") from a folder and the tfw which are related.The intention was to run this script as an intermediate solution on a laptop with QGIS and therefore OSGeo4W Shell, without requiring additional Python packages, so it can be run on a PC with a standard QGIS installation.
- Size check: Check siz from image
- Search data name: Search for a tfw with the same name as a TIF.
- Delete files: Delet TIFs and TWs.
- TXT File Generation: Write log file with deletes Filenames.
To use this script, run the following command in your OSGeo4W Shell with a standard QGIS installation:
python rm_remove_leeren_TIFS.py
This script processes PUG images example by extracting EXIF data, applying mask, and creating a KML file with image previews and location data.
- Extracts text from predefined bounding boxes using EasyOCR.
- Applies mask to images and saves the masked images.
- Extracts and modifies EXIF data (date, time, GPS coordinates).
- Generates a KML file with image previews and coordinates.
- Logs errors for images that cannot be georeferenced.
This scripts needs some additional Python modules. Tested with Python 3.10.12 and 3.11.9.
pip install -r requirements.txt
python rm_process_pug_images.py
- Run the script.
- Enter the input directory path containing PNG images.
- Enter the output directory path where processed images and KML file will be saved.
- If
pgu_mask.png
is not found in the current directory, provide the path to it. - The script will process each image, apply masks, extract EXIF data, and create a KML file with image previews and coordinates.
- An error file (
not_processed.txt
) will be generated for files that could not be georeferenced.
Download from v0.0.1-alpha
pgu_mask.png
- folder
models
including content rm_process_pug_images.exe
- Run
rm_process_pug_images.exe
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the BSD-3-Clause License. See LICENSE.txt
for more information.
info[ a t]rapidmapping.admin.ch