PDOK geotiff-validator
The PDOK geotiff validator is used by PDOK. PDOK is part of the Dutch government. This geotiff validator is used to validate a set of requirements to make sure geotiffs adhere to our standardized ETL pipeline. It is possible to use this for your own purposes. The validations will not change (except for bugfixes); new validations are always added to the list.
Table of Contents
TL;DR Commands
Either run through docker or locally.
Docker
Validate a single GeoTiff file with the default set of validation rules:
geotiff_path=relative/path/to/the.tif
docker run -v "$(pwd)":/tiff --rm pdok/geotiff-validator validate --geotiff-path "/tiff/${geotiff_path}"
Validate a GeoTiff folder with the default set of validation rules:
geotiff_path=relative/path/to/the.tif
docker run -v "$(pwd)":/tiff --rm pdok/geotiff-validator validate --folder-path "/tiff/"
Generate definitions for a folder containing GeoTiffs:
geotiff_path=relative/path/to/the.tif
docker run -v "$(pwd)":/tiff --rm pdok/geotiff-validator generate-definitions --folder-path "/tiff/"
What does it do
The GeoTiff validator can validate Geotiff files (.tif files with GeoTiff extension) to see if they conform to a set of standards. The current checks are (see also the 'show-validations' command)
| Validation code | Description |
|---|---|
| 0 | The file must exist and be a valid GeoTiff |
| 1 | The GeoTiff must be a Cloud Optimized GeoTiff(COG) |
| 2 | The GeoTiff must be compressed with LZW |
| 3 | The GeoTiff must not have views |
| 4 | The GeoTiff must match the generated schema |
Note to PDOK developers: make sure to update the Kangaroo webinterface when adding a new validation.
Installation
This package requires:
- GDAL version == 3.11.5.
- And python >= 3.10 to run.
Docker Installation
Pull the latest version of the Docker image (only once needed, or after an update)
docker pull pdok/geotiff-validator:latest
Or build the Docker image from source:
docker build -t pdok/geotiff-validator .
The command is directly called so subcommands can be run in the container directly:
docker run -v ${PWD}:/tiff --rm pdok/geotiff-validator validate --definitions-path /path/to/schema_definitions.json --geotiff-path /tiff/tests/data/single_files/test_correct.tif
Usage
Validate
Usage: geotiff-validator validate [OPTIONS]
Geotiff validator validating one or more tiff files.
Options:
--geotiff-path FILE Path pointing to the geotiff .tif file [env
var: GEOTIFF_PATH]
--folder-path DIRECTORY Path pointing to a folder containing geotiff
.tif files [env var: FOLDER_PATH]
--definitions-path FILE Path pointing to the geotiff-definitions
JSON or YAML file (generate this file by
calling the generate-definitions command)
--required-validations TEXT Comma-separated list of validations to run
(e.g. --required-validations 1,2,3). If
validations-path, required-validations and
recommended-validations are not given,
validate runs all validations [env var:
REQUIRED_VALIDATIONS]
--recommended-validations TEXT Comma-separated list of validations to run
(e.g. --recommended-validations 1,2,3). If
validations-path, required-validations and
recommended-validations are not given,
validate runs all validations [env var:
RECOMMENDED_VALIDATIONS]
--validations-path TEXT Path pointing to the set of validations to
run. If validations-path, required-
validations and recommended-validations are
not given, validate runs all validations
[env var: VALIDATIONS_PATH]
--exit-on-fail Exit with code 1 when validation success is
false.
--help Show this message and exit.
Schema validation
To validate schemas (validation #4) you have to generate definitions first.
docker run -v ${PWD}:/gpkg --rm pdok/geotiff-validator geotiff-validator generate-definitions --folder-path /mytifffolder
Show validations
Show all the possible validations that are executed in the validate command.
Usage: geotiff-validator show-validations [OPTIONS]
Show all the possible validations that can be executed in the validate
command.
Options:
--no-legacy Output without Legacy checks
--yaml Output yaml
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG
--help Show this message and exit.
Generate schema definitions
Usage: geotiff-validator generate-definitions [OPTIONS]
Generate schema definition for one or multiple tifs . Use the
generated definition JSON or YAML in the validation step by providing the
table definitions with the --definitions-path parameter.
Options:
--folder-path DIRECTORY Path pointing to the folder containing the geotiff
files [env var: FOLDER_PATH]
--geotiff-path FILE Path pointing to the geotiff .tif file [env var:
GEOTIFF_PATH]
--help Show this message and exit.
Tests
Run the tests regularly.
pytest .
Releasing
Release in github by creating a new release in github.
Metadata
Release files for pdok-geotiff-validator 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdok_geotiff_validator-0.0.4.tar.gz | 19.7 kB | Without provenance | Details for pdok_geotiff_validator-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdok_geotiff_validator-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for pdok_geotiff_validator-0.0.4-py3-none-any.whl |
Total release size: 39.3 kB
Release files / pdok_geotiff_validator-0.0.4.tar.gz
| Download URL | pdok_geotiff_validator-0.0.4.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41cd7c98e1cf5408cacee361397f76795adee6871c5cb8e8cf02dffa218fa512
|
|
BLAKE2b-256 checksum How to use checksums |
4af8f85cf813a609359dbc8ea1236092d415ee5cd7ae7bba257b01b57e7b8720
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / pdok_geotiff_validator-0.0.4-py3-none-any.whl
| Download URL | pdok_geotiff_validator-0.0.4-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c69e4140fa3b44d8a0b43ce360dbd3e96dd70fe190e3165c92b1f7a5c320d98
|
|
BLAKE2b-256 checksum How to use checksums |
782c12e885b7e24b1aae9fe0f681aa3b13dbdac518705f619cd5221294dc8aca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for pdok-geotiff-validator 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.