Name | pdok-geopackage-validator JSON |
Version |
0.8.2
JSON |
| download |
home_page | |
Summary | Validate Geopackage files according to PDOK requirements and recommendations |
upload_time | 2023-01-10 12:52:17 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
license | MIT |
keywords |
geopackage-validator
geopackage
pdok
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# geopackage-validator
[![Tests](https://github.com/pdok/geopackage-validator/actions/workflows/pytest.yml/badge.svg)](https://github.com/pdok/geopackage-validator/actions/workflows/pytest.yml)[![PyPI version](https://badge.fury.io/py/pdok-geopackage-validator.svg)](https://pypi.org/project/pdok-geopackage-validator/)
## Table of Contents
- [geopackage-validator](#geopackage-validator)
- [Table of Contents](#table-of-contents)
- [What does it do](#what-does-it-do)
- [Geopackage versions](#geopackage-versions)
- [Installation](#installation)
- [Docker](#docker)
- [Usage](#usage)
- [RQ8 Validation](#rq8-validation)
- [Show validations](#show-validations)
- [Generate table definitions](#generate-table-definitions)
- [Local development](#local-development)
- [Usage](#usage-1)
- [Python console](#python-console)
- [Code style](#code-style)
- [Tests](#tests)
- [Releasing](#releasing)
## TL;DR Commands
Validate a GeoPackage with the default set of validation rules:
```sh
gpkg_path=relative/path/to/the.gpkg
docker run -v "$(pwd)":/gpkg --rm pdok/geopackage-validator validate --gpkg-path "/gpkg/${gpkg_path}"
```
Validate a GeoPackage with the default set of validation rules including a schema:
```sh
schema_path=relative/path/to/the/schema.json
gpkg_path=relative/path/to/the.gpkg
docker run -v "$(pwd)":/gpkg --rm pdok/geopackage-validator validate --gpkg-path "/gpkg/${gpkg_path}" --table-definitions-path "/gpkg/${schema_path}"
```
Generate a schema:
```sh
schema_path=relative/path/to/the/schema.json
gpkg_path=relative/path/to/the.gpkg
docker run -v "$(pwd)":/gpkg --rm pdok/geopackage-validator generate-definitions --gpkg-path "/gpkg/${gpkg_path}" > "$schema_path"
```
## What does it do
The Geopackage validator can validate .gkpg files to see if they conform to a set of standards.
The current checks are (see also the 'show-validations' command):
| Validation code** | Description |
|:-----------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| UNKNOWN_ERROR | No unexpected (GDAL) errors must occur. |
| RQ0 | _LEGACY:_ * Geopackage must conform to table names in the given JSON or YAML definitions. |
| RQ1 | Layer names must start with a letter, and valid characters are lowercase a-z, numbers or underscores. |
| RQ2 | Layers must have at least one feature. |
| RQ3 | _LEGACY:_ * Layer features should have an allowed geometry_type (one of POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, or MULTIPOLYGON). |
| RQ4 | The geopackage should have no views defined. |
| RQ5 | Geometry should be valid. |
| RQ6 | Column names must start with a letter, and valid characters are lowercase a-z, numbers or underscores. |
| RQ7 | Tables should have a feature id column with unique index. |
| RQ8 | Geopackage must conform to given JSON or YAML definitions. |
| RQ9 | All geometry tables must have an rtree index. |
| RQ10 | All geometry table rtree indexes must be valid. |
| RQ11 | OGR indexed feature counts must be up to date. |
| RQ12 | Only the following EPSG spatial reference systems are allowed: 28992, 3034, 3035, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 4258, 4936, 4937, 5730, 7409. |
| RQ13 | It is required to give all GEOMETRY features the same default spatial reference system. |
| RQ14 | The geometry_type_name from the gpkg_geometry_columns table must be one of POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, or MULTIPOLYGON. |
| RQ15 | All table geometries must match the geometry_type_name from the gpkg_geometry_columns table. |
| RQ16 | All layer and column names shall not be longer than 53 characters. |
| RC17 | It is recommended to name all GEOMETRY type columns 'geom'. |
| RC18 | It is recommended to give all GEOMETRY type columns the same name. |
| RC19 | It is recommended to only use multidimensional geometry coordinates (elevation and measurement) when necessary. |
| RC20 | It is recommended that all (MULTI)POLYGON geometries have a counter-clockwise orientation for their exterior ring, and a clockwise direction for all interior rings. |
| UNKNOWN_WARNINGS | It is recommended that the unexpected (GDAL) warnings are looked into. |
\* Legacy requirements are only executed with the validate command when explicitly requested in the validation set.
\** Since version 0.8.0 the recommendations are part of the same sequence as the requirements. From now on a check will always maintain the integer part of the code. Even if at a later time the validation type can shift between requirement and recommendation.
An explanation in Dutch with a reason for each rule can be found [here](https://www.pdok.nl/voor-data-aanbieders#:~:text=Regels%20in%20detail).
## Geopackage versions
The Geopackage validator support the following Geopackage versions:
- 1.3.1
- 1.3
- 1.2.1
## Installation
This package requires:
- [GDAL](https://gdal.org/) version >= 3.2.1.
- [Spatialite](https://www.gaia-gis.it/fossil/libspatialite/index) version >= 5.0.0
- And python >= 3.8 to run.
We recommend using the docker image. When above requirements are met the package can be installed using pip (`pip install pdok-geopackage-validator`).
### Docker
Pull the latest version of the Docker image (only once needed, or after an update)
```bash
docker pull pdok/geopackage-validator:latest
```
Or build the Docker image from source:
```bash
docker build -t pdok/geopackage-validator .
```
The command is directly called so subcommands can be run in the container directly:
```bash
docker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate -t /path/to/generated_definitions.json --gpkg-path /gpkg/tests/data/test_allcorrect.gpkg
```
## Usage
### RQ8 Validation
To validate RQ8 you have to generate definitions first.
```bash
docker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator geopackage-validator generate-definitions --gpkg-path /path/to/file.gpkg
````
### Validate
```bash
Usage: geopackage-validator validate [OPTIONS]
Geopackage validator validating a local file or a file from S3 storage.
When the filepath is preceded with '/vsis3' or '/vsicurl' the gdal virtual
file system will be used to access the file on S3 and will not be directly
downloaded. See https://gdal.org/user/virtual_file_systems.html for
further explanation how to use gdal virtual file systems. For convenience
the gdal vsi environment parameters and optional parameters are provided
with an S3_ instead of an AWS_ prefix. The AWS_ environment parameters
will also work.
Examples:
viscurl:
geopackage-validator validate --gpkg-path /vsicurl/http://minio-
url.nl/bucketname/key/to/public.gpkg
vsis3:
geopackage-validator validate --gpkg-path
/vsis3/bucketname/key/to/public.gpkg --s3-signing-region eu-central-1
--s3-secret-key secret --s3-access-key acces-key --s3-secure=false
--s3-virtual-hosting false --s3-endpoint-no-protocol minio-url.nl
S3_SECRET_KEY=secret S3_ACCESS_KEY=acces-key S3_SIGNING_REGION=eu-
central-1 S3_SECURE=false S3_VIRTUAL_HOSTING=false
S3_ENDPOINT_NO_PROTOCOL=minio-url.nl geopackage-validator validate --gpkg-
path /vsis3/bucketname/key/to/public.gpkg
AWS_SECRET_ACCESS_KEY=secret AWS_ACCESS_KEY_ID=acces-key
AWS_DEFAULT_REGION=eu-central-1 AWS_HTTPS=NO AWS_VIRTUAL_HOSTING=FALSE
AWS_S3_ENDPOINT=minio-url.nl geopackage-validator validate --gpkg-path
/vsis3/bucketname/key/to/public.gpkg
Options:
--gpkg-path FILE Path pointing to the geopackage.gpkg file
[env var: GPKG_PATH]
-t, --table-definitions-path FILE
Path pointing to the table-definitions JSON
or YAML file (generate this file by calling
the generate-definitions command)
--validations-path FILE Path pointing to the set of validations to
run. If validations-path and validations are
not given, validate runs all validations
[env var: VALIDATIONS_FILE]
--validations TEXT Comma-separated list of validations to run
(e.g. --validations RQ1,RQ2,RQ3). If
validations-path and validations are not
given, validate runs all validations [env
var: VALIDATIONS]
--exit-on-fail Exit with code 1 when validation success is
false.
--yaml Output yaml.
--s3-endpoint-no-protocol TEXT Endpoint for the s3 service without protocol
[env var: S3_ENDPOINT_NO_PROTOCOL]
--s3-access-key TEXT Access key for the s3 service [env var:
S3_ACCESS_KEY]
--s3-secret-key TEXT Secret key for the s3 service [env var:
S3_SECRET_KEY]
--s3-bucket TEXT Bucket where the geopackage is on the s3
service [env var: S3_BUCKET]
--s3-key TEXT Key where the geopackage is in the bucket
[env var: S3_KEY]
--s3-secure BOOLEAN Use a secure TLS connection for S3. [env
var: S3_SECURE]
--s3-virtual-hosting TEXT TRUE value, identifies the bucket via a
virtual bucket host name, e.g.:
mybucket.cname.domain.com - FALSE value,
identifies the bucket as the top-level
directory in the URI, e.g.:
cname.domain.com/mybucket. Convenience
parameter, same as gdal AWS_VIRTUAL_HOSTING.
[env var: S3_VIRTUAL_HOSTING]
--s3-signing-region TEXT S3 signing region. Convenience parameter,
same as gdal AWS_DEFAULT_REGION. [env var:
S3_SIGNING_REGION]
--s3-no-sign-request TEXT When set, request signing is disabled. This
option might be used for buckets with public
access rights. Convenience parameter, same
as gdal AWS_NO_SIGN_REQUEST. [env var:
S3_NO_SIGN_REQUEST]
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or
DEBUG
--help Show this message and exit.
```
Examples:
```bash
docker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate -t /path/to/generated_definitions.json --gpkg-path /gpkg/tests/data/test_allcorrect.gpkg
```
Run with specific validations only
Specified in file:
```bash
docker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate --gpkg-path tests/data/test_allcorrect.gpkg --validations-path tests/validationsets/example-validation-set.json
```
Or specified on command line:
```bash
docker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate --gpkg-path tests/data/test_allcorrect.gpkg --validations RQ1,RQ2,RQ3
```
### Show validations
Show all the possible validations that are executed in the validate command.
```bash
Usage: geopackage-validator show-validations [OPTIONS]
Show all the possible validations that are executed in the validate
command.
Options:
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG
--help Show this message and exit.
```
### Generate table definitions
```bash
Usage: geopackage-validator generate-definitions [OPTIONS]
Generate table definition for a geopackage on local or S3 storage. Use the
generated definition JSON or YAML in the validation step by providing the
table definitions with the --table-definitions-path parameter. When the
filepath is preceded with '/vsi' the gdal virtual file system method will
be used to access the file on S3 and will not be directly downloaded. See
https://gdal.org/user/virtual_file_systems.html for further explanation.
For convenience the gdal vsi environment parameters and optional
parameters are provided with an S3_ instead of an AWS_ prefix. The AWS_
environment parameters will also work.
Examples:
viscurl:
geopackage-validator validate --gpkg-path /vsicurl/http://minio-
url.nl/bucketname/key/to/public.gpkg
vsis3:
geopackage-validator generate-definitions --gpkg-path
/vsis3/bucketname/key/to/public.gpkg --s3-signing-region eu-central-1
--s3-secret-key secret --s3-access-key acces-key --s3-secure=false
--s3-virtual-hosting false --s3-endpoint-no-protocol minio-url.nl
S3_SECRET_KEY=secret S3_ACCESS_KEY=acces-key S3_SIGNING_REGION=eu-
central-1 S3_SECURE=false S3_VIRTUAL_HOSTING=false
S3_ENDPOINT_NO_PROTOCOL=minio-url.nl geopackage-validator generate-definitions --gpkg-
path /vsis3/bucketname/key/to/public.gpkg
AWS_SECRET_ACCESS_KEY=secret AWS_ACCESS_KEY_ID=acces-key
AWS_DEFAULT_REGION=eu-central-1 AWS_HTTPS=NO AWS_VIRTUAL_HOSTING=FALSE
AWS_S3_ENDPOINT=minio-url.nl geopackage-validator generate-definitions --gpkg-path
/vsis3/bucketname/key/to/public.gpkg
Options:
--gpkg-path FILE Path pointing to the geopackage.gpkg file
[env var: GPKG_PATH]
--yaml Output yaml
--s3-endpoint-no-protocol TEXT Endpoint for the s3 service without protocol
[env var: S3_ENDPOINT_NO_PROTOCOL]
--s3-access-key TEXT Access key for the s3 service [env var:
S3_ACCESS_KEY]
--s3-secret-key TEXT Secret key for the s3 service [env var:
S3_SECRET_KEY]
--s3-bucket TEXT Bucket where the geopackage is on the s3
service [env var: S3_BUCKET]
--s3-key TEXT Key where the geopackage is in the bucket
[env var: S3_KEY]
--s3-secure BOOLEAN Use a secure TLS connection for S3. [env
var: S3_SECURE]
--s3-virtual-hosting TEXT TRUE value, identifies the bucket via a
virtual bucket host name, e.g.:
mybucket.cname.domain.com - FALSE value,
identifies the bucket as the top-level
directory in the URI, e.g.:
cname.domain.com/mybucket. Convenience
parameter, same as gdal AWS_VIRTUAL_HOSTING.
[env var: S3_VIRTUAL_HOSTING]
--s3-signing-region TEXT S3 signing region. Convenience parameter,
same as gdal AWS_DEFAULT_REGION. [env var:
S3_SIGNING_REGION]
--s3-no-sign-request TEXT When set, request signing is disabled. This
option might be used for buckets with public
access rights. Convenience parameter, same
as gdal AWS_NO_SIGN_REQUEST. [env var:
S3_NO_SIGN_REQUEST]
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or
DEBUG
--help Show this message and exit.
```
## Local development
We advise using docker-compose for local development. This allows live editing and testing code with the correct gdal/ogr version with spatialite 5.0.0.
First build the local image with your machines user id and group id:
```bash
docker-compose build --build-arg USER_ID=`id -u` --build-arg GROUP_ID=`id -g`
```
### Usage
There will be a script you can run like this:
```bash
docker-compose run --rm validator geopackage-validator
```
This command has direct access to the files found in this directory. In case you want
to point the docker-compose to other files, you can add or edit the volumes in the `docker-compose.yaml`
### Python console
Ipython is available in the docker:
```bash
docker-compose run --rm validator ipython
```
### Code style
In order to get nicely formatted python files without having to spend manual
work on it, run the following command periodically:
```bash
docker-compose run --rm validator black .
```
### Tests
Run the tests regularly. This also checks with pyflakes and black:
```bash
docker-compose run --rm validator pytest
```
### Releasing
Release in github by bumping the `__version__` in [`geopackage_validator.constants.py`](geopackage_validator/constants.py) and by creating and pushing a new tag to master and create a new release in github.
Raw data
{
"_id": null,
"home_page": "",
"name": "pdok-geopackage-validator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "geopackage-validator,geopackage,pdok",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/6e/e4/b879edebcfd7151fef7ed447e437188a7ff100b9965bcade547f0cd1e94b/pdok-geopackage-validator-0.8.2.tar.gz",
"platform": null,
"description": "# geopackage-validator\n\n[![Tests](https://github.com/pdok/geopackage-validator/actions/workflows/pytest.yml/badge.svg)](https://github.com/pdok/geopackage-validator/actions/workflows/pytest.yml)[![PyPI version](https://badge.fury.io/py/pdok-geopackage-validator.svg)](https://pypi.org/project/pdok-geopackage-validator/)\n\n## Table of Contents\n\n- [geopackage-validator](#geopackage-validator)\n - [Table of Contents](#table-of-contents)\n - [What does it do](#what-does-it-do)\n - [Geopackage versions](#geopackage-versions)\n - [Installation](#installation)\n - [Docker](#docker)\n - [Usage](#usage)\n - [RQ8 Validation](#rq8-validation)\n - [Show validations](#show-validations)\n - [Generate table definitions](#generate-table-definitions)\n - [Local development](#local-development)\n - [Usage](#usage-1)\n - [Python console](#python-console)\n - [Code style](#code-style)\n - [Tests](#tests)\n - [Releasing](#releasing)\n\n## TL;DR Commands\n\nValidate a GeoPackage with the default set of validation rules:\n\n```sh\ngpkg_path=relative/path/to/the.gpkg\ndocker run -v \"$(pwd)\":/gpkg --rm pdok/geopackage-validator validate --gpkg-path \"/gpkg/${gpkg_path}\" \n```\n\nValidate a GeoPackage with the default set of validation rules including a schema:\n\n```sh\nschema_path=relative/path/to/the/schema.json\ngpkg_path=relative/path/to/the.gpkg\ndocker run -v \"$(pwd)\":/gpkg --rm pdok/geopackage-validator validate --gpkg-path \"/gpkg/${gpkg_path}\" --table-definitions-path \"/gpkg/${schema_path}\" \n```\n\nGenerate a schema: \n\n```sh\nschema_path=relative/path/to/the/schema.json\ngpkg_path=relative/path/to/the.gpkg\ndocker run -v \"$(pwd)\":/gpkg --rm pdok/geopackage-validator generate-definitions --gpkg-path \"/gpkg/${gpkg_path}\" > \"$schema_path\" \n```\n\n## What does it do\n\nThe Geopackage validator can validate .gkpg files to see if they conform to a set of standards.\nThe current checks are (see also the 'show-validations' command):\n\n| Validation code** | Description |\n|:-----------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| UNKNOWN_ERROR | No unexpected (GDAL) errors must occur. |\n| RQ0 | _LEGACY:_ * Geopackage must conform to table names in the given JSON or YAML definitions. |\n| RQ1 | Layer names must start with a letter, and valid characters are lowercase a-z, numbers or underscores. |\n| RQ2 | Layers must have at least one feature. |\n| RQ3 | _LEGACY:_ * Layer features should have an allowed geometry_type (one of POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, or MULTIPOLYGON). |\n| RQ4 | The geopackage should have no views defined. |\n| RQ5 | Geometry should be valid. |\n| RQ6 | Column names must start with a letter, and valid characters are lowercase a-z, numbers or underscores. |\n| RQ7 | Tables should have a feature id column with unique index. |\n| RQ8 | Geopackage must conform to given JSON or YAML definitions. |\n| RQ9 | All geometry tables must have an rtree index. |\n| RQ10 | All geometry table rtree indexes must be valid. |\n| RQ11 | OGR indexed feature counts must be up to date. |\n| RQ12 | Only the following EPSG spatial reference systems are allowed: 28992, 3034, 3035, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048, 3049, 3050, 3051, 4258, 4936, 4937, 5730, 7409. |\n| RQ13 | It is required to give all GEOMETRY features the same default spatial reference system. |\n| RQ14 | The geometry_type_name from the gpkg_geometry_columns table must be one of POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, or MULTIPOLYGON. |\n| RQ15 | All table geometries must match the geometry_type_name from the gpkg_geometry_columns table. |\n| RQ16 | All layer and column names shall not be longer than 53 characters. |\n| RC17 | It is recommended to name all GEOMETRY type columns 'geom'. |\n| RC18 | It is recommended to give all GEOMETRY type columns the same name. |\n| RC19 | It is recommended to only use multidimensional geometry coordinates (elevation and measurement) when necessary. |\n| RC20 | It is recommended that all (MULTI)POLYGON geometries have a counter-clockwise orientation for their exterior ring, and a clockwise direction for all interior rings. |\n| UNKNOWN_WARNINGS | It is recommended that the unexpected (GDAL) warnings are looked into. |\n\n\\* Legacy requirements are only executed with the validate command when explicitly requested in the validation set. \n\\** Since version 0.8.0 the recommendations are part of the same sequence as the requirements. From now on a check will always maintain the integer part of the code. Even if at a later time the validation type can shift between requirement and recommendation. \n\nAn explanation in Dutch with a reason for each rule can be found [here](https://www.pdok.nl/voor-data-aanbieders#:~:text=Regels%20in%20detail).\n\n## Geopackage versions\n\nThe Geopackage validator support the following Geopackage versions:\n- 1.3.1\n- 1.3\n- 1.2.1\n\n## Installation\n\nThis package requires:\n- [GDAL](https://gdal.org/) version >= 3.2.1.\n- [Spatialite](https://www.gaia-gis.it/fossil/libspatialite/index) version >= 5.0.0\n- And python >= 3.8 to run.\n\nWe recommend using the docker image. When above requirements are met the package can be installed using pip (`pip install pdok-geopackage-validator`). \n\n### Docker\n\nPull the latest version of the Docker image (only once needed, or after an update)\n\n```bash\ndocker pull pdok/geopackage-validator:latest\n```\n\nOr build the Docker image from source:\n\n```bash\ndocker build -t pdok/geopackage-validator .\n```\n\nThe command is directly called so subcommands can be run in the container directly:\n\n```bash\ndocker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate -t /path/to/generated_definitions.json --gpkg-path /gpkg/tests/data/test_allcorrect.gpkg\n```\n\n## Usage\n\n### RQ8 Validation\n\nTo validate RQ8 you have to generate definitions first.\n\n```bash\ndocker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator geopackage-validator generate-definitions --gpkg-path /path/to/file.gpkg\n````\n\n### Validate\n\n```bash\nUsage: geopackage-validator validate [OPTIONS]\n\n Geopackage validator validating a local file or a file from S3 storage.\n When the filepath is preceded with '/vsis3' or '/vsicurl' the gdal virtual\n file system will be used to access the file on S3 and will not be directly\n downloaded. See https://gdal.org/user/virtual_file_systems.html for\n further explanation how to use gdal virtual file systems. For convenience\n the gdal vsi environment parameters and optional parameters are provided\n with an S3_ instead of an AWS_ prefix. The AWS_ environment parameters\n will also work.\n\n Examples:\n\n viscurl:\n\n geopackage-validator validate --gpkg-path /vsicurl/http://minio-\n url.nl/bucketname/key/to/public.gpkg\n\n vsis3:\n\n geopackage-validator validate --gpkg-path\n /vsis3/bucketname/key/to/public.gpkg --s3-signing-region eu-central-1\n --s3-secret-key secret --s3-access-key acces-key --s3-secure=false\n --s3-virtual-hosting false --s3-endpoint-no-protocol minio-url.nl\n\n S3_SECRET_KEY=secret S3_ACCESS_KEY=acces-key S3_SIGNING_REGION=eu-\n central-1 S3_SECURE=false S3_VIRTUAL_HOSTING=false\n S3_ENDPOINT_NO_PROTOCOL=minio-url.nl geopackage-validator validate --gpkg-\n path /vsis3/bucketname/key/to/public.gpkg\n\n AWS_SECRET_ACCESS_KEY=secret AWS_ACCESS_KEY_ID=acces-key\n AWS_DEFAULT_REGION=eu-central-1 AWS_HTTPS=NO AWS_VIRTUAL_HOSTING=FALSE\n AWS_S3_ENDPOINT=minio-url.nl geopackage-validator validate --gpkg-path\n /vsis3/bucketname/key/to/public.gpkg\n\nOptions:\n --gpkg-path FILE Path pointing to the geopackage.gpkg file\n [env var: GPKG_PATH]\n\n -t, --table-definitions-path FILE\n Path pointing to the table-definitions JSON\n or YAML file (generate this file by calling\n the generate-definitions command)\n\n --validations-path FILE Path pointing to the set of validations to\n run. If validations-path and validations are\n not given, validate runs all validations\n [env var: VALIDATIONS_FILE]\n\n --validations TEXT Comma-separated list of validations to run\n (e.g. --validations RQ1,RQ2,RQ3). If\n validations-path and validations are not\n given, validate runs all validations [env\n var: VALIDATIONS]\n\n --exit-on-fail Exit with code 1 when validation success is\n false.\n\n --yaml Output yaml.\n --s3-endpoint-no-protocol TEXT Endpoint for the s3 service without protocol\n [env var: S3_ENDPOINT_NO_PROTOCOL]\n\n --s3-access-key TEXT Access key for the s3 service [env var:\n S3_ACCESS_KEY]\n\n --s3-secret-key TEXT Secret key for the s3 service [env var:\n S3_SECRET_KEY]\n\n --s3-bucket TEXT Bucket where the geopackage is on the s3\n service [env var: S3_BUCKET]\n\n --s3-key TEXT Key where the geopackage is in the bucket\n [env var: S3_KEY]\n\n --s3-secure BOOLEAN Use a secure TLS connection for S3. [env\n var: S3_SECURE]\n\n --s3-virtual-hosting TEXT TRUE value, identifies the bucket via a\n virtual bucket host name, e.g.:\n mybucket.cname.domain.com - FALSE value,\n identifies the bucket as the top-level\n directory in the URI, e.g.:\n cname.domain.com/mybucket. Convenience\n parameter, same as gdal AWS_VIRTUAL_HOSTING.\n [env var: S3_VIRTUAL_HOSTING]\n\n --s3-signing-region TEXT S3 signing region. Convenience parameter,\n same as gdal AWS_DEFAULT_REGION. [env var:\n S3_SIGNING_REGION]\n\n --s3-no-sign-request TEXT When set, request signing is disabled. This\n option might be used for buckets with public\n access rights. Convenience parameter, same\n as gdal AWS_NO_SIGN_REQUEST. [env var:\n S3_NO_SIGN_REQUEST]\n\n -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or\n DEBUG\n\n --help Show this message and exit.\n```\n\nExamples:\n\n```bash\ndocker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate -t /path/to/generated_definitions.json --gpkg-path /gpkg/tests/data/test_allcorrect.gpkg\n```\n\nRun with specific validations only\n\nSpecified in file:\n\n```bash\ndocker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate --gpkg-path tests/data/test_allcorrect.gpkg --validations-path tests/validationsets/example-validation-set.json\n```\n\nOr specified on command line:\n\n```bash\ndocker run -v ${PWD}:/gpkg --rm pdok/geopackage-validator validate --gpkg-path tests/data/test_allcorrect.gpkg --validations RQ1,RQ2,RQ3\n```\n\n### Show validations\n\nShow all the possible validations that are executed in the validate command.\n\n```bash\nUsage: geopackage-validator show-validations [OPTIONS]\n\n Show all the possible validations that are executed in the validate\n command.\n\nOptions:\n -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or DEBUG\n --help Show this message and exit.\n```\n\n### Generate table definitions\n\n```bash\nUsage: geopackage-validator generate-definitions [OPTIONS]\n\n Generate table definition for a geopackage on local or S3 storage. Use the\n generated definition JSON or YAML in the validation step by providing the\n table definitions with the --table-definitions-path parameter. When the\n filepath is preceded with '/vsi' the gdal virtual file system method will\n be used to access the file on S3 and will not be directly downloaded. See\n https://gdal.org/user/virtual_file_systems.html for further explanation.\n For convenience the gdal vsi environment parameters and optional\n parameters are provided with an S3_ instead of an AWS_ prefix. The AWS_\n environment parameters will also work.\n\n Examples:\n\n viscurl:\n\n geopackage-validator validate --gpkg-path /vsicurl/http://minio-\n url.nl/bucketname/key/to/public.gpkg\n\n vsis3:\n\n geopackage-validator generate-definitions --gpkg-path\n /vsis3/bucketname/key/to/public.gpkg --s3-signing-region eu-central-1\n --s3-secret-key secret --s3-access-key acces-key --s3-secure=false\n --s3-virtual-hosting false --s3-endpoint-no-protocol minio-url.nl\n\n S3_SECRET_KEY=secret S3_ACCESS_KEY=acces-key S3_SIGNING_REGION=eu-\n central-1 S3_SECURE=false S3_VIRTUAL_HOSTING=false\n S3_ENDPOINT_NO_PROTOCOL=minio-url.nl geopackage-validator generate-definitions --gpkg-\n path /vsis3/bucketname/key/to/public.gpkg\n\n AWS_SECRET_ACCESS_KEY=secret AWS_ACCESS_KEY_ID=acces-key\n AWS_DEFAULT_REGION=eu-central-1 AWS_HTTPS=NO AWS_VIRTUAL_HOSTING=FALSE\n AWS_S3_ENDPOINT=minio-url.nl geopackage-validator generate-definitions --gpkg-path\n /vsis3/bucketname/key/to/public.gpkg\n\nOptions:\n --gpkg-path FILE Path pointing to the geopackage.gpkg file\n [env var: GPKG_PATH]\n\n --yaml Output yaml\n --s3-endpoint-no-protocol TEXT Endpoint for the s3 service without protocol\n [env var: S3_ENDPOINT_NO_PROTOCOL]\n\n --s3-access-key TEXT Access key for the s3 service [env var:\n S3_ACCESS_KEY]\n\n --s3-secret-key TEXT Secret key for the s3 service [env var:\n S3_SECRET_KEY]\n\n --s3-bucket TEXT Bucket where the geopackage is on the s3\n service [env var: S3_BUCKET]\n\n --s3-key TEXT Key where the geopackage is in the bucket\n [env var: S3_KEY]\n\n --s3-secure BOOLEAN Use a secure TLS connection for S3. [env\n var: S3_SECURE]\n\n --s3-virtual-hosting TEXT TRUE value, identifies the bucket via a\n virtual bucket host name, e.g.:\n mybucket.cname.domain.com - FALSE value,\n identifies the bucket as the top-level\n directory in the URI, e.g.:\n cname.domain.com/mybucket. Convenience\n parameter, same as gdal AWS_VIRTUAL_HOSTING.\n [env var: S3_VIRTUAL_HOSTING]\n\n --s3-signing-region TEXT S3 signing region. Convenience parameter,\n same as gdal AWS_DEFAULT_REGION. [env var:\n S3_SIGNING_REGION]\n\n --s3-no-sign-request TEXT When set, request signing is disabled. This\n option might be used for buckets with public\n access rights. Convenience parameter, same\n as gdal AWS_NO_SIGN_REQUEST. [env var:\n S3_NO_SIGN_REQUEST]\n\n -v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or\n DEBUG\n\n --help Show this message and exit.\n```\n\n## Local development\n\nWe advise using docker-compose for local development. This allows live editing and testing code with the correct gdal/ogr version with spatialite 5.0.0. \nFirst build the local image with your machines user id and group id: \n\n```bash\ndocker-compose build --build-arg USER_ID=`id -u` --build-arg GROUP_ID=`id -g`\n```\n\n### Usage\n\nThere will be a script you can run like this:\n\n```bash\ndocker-compose run --rm validator geopackage-validator\n```\n\nThis command has direct access to the files found in this directory. In case you want\nto point the docker-compose to other files, you can add or edit the volumes in the `docker-compose.yaml`\n\n### Python console\n\nIpython is available in the docker: \n\n```bash\ndocker-compose run --rm validator ipython\n```\n\n### Code style\n\nIn order to get nicely formatted python files without having to spend manual\nwork on it, run the following command periodically:\n\n```bash\ndocker-compose run --rm validator black .\n``` \n\n### Tests\n\nRun the tests regularly. This also checks with pyflakes and black:\n\n```bash\ndocker-compose run --rm validator pytest\n```\n\n### Releasing\n\nRelease in github by bumping the `__version__` in [`geopackage_validator.constants.py`](geopackage_validator/constants.py) and by creating and pushing a new tag to master and create a new release in github. \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Validate Geopackage files according to PDOK requirements and recommendations",
"version": "0.8.2",
"split_keywords": [
"geopackage-validator",
"geopackage",
"pdok"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3acac187b89ff27f618a5fdd6055ba7cb2ff2ca2ec9388301853827a97240667",
"md5": "733e43b384a7e50cb007e1f49b8fad61",
"sha256": "443e50c4f5c8a76f5601cd7e43266efbb8cf44f0d54806f39380f130a62a63eb"
},
"downloads": -1,
"filename": "pdok_geopackage_validator-0.8.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "733e43b384a7e50cb007e1f49b8fad61",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 32956,
"upload_time": "2023-01-10T12:52:15",
"upload_time_iso_8601": "2023-01-10T12:52:15.507563Z",
"url": "https://files.pythonhosted.org/packages/3a/ca/c187b89ff27f618a5fdd6055ba7cb2ff2ca2ec9388301853827a97240667/pdok_geopackage_validator-0.8.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6ee4b879edebcfd7151fef7ed447e437188a7ff100b9965bcade547f0cd1e94b",
"md5": "c735c11c9c883955ea4c54ec4e18a616",
"sha256": "02fc87419fb517d6de98b26a556f817622197867a621b8768b3e3e2e0781da08"
},
"downloads": -1,
"filename": "pdok-geopackage-validator-0.8.2.tar.gz",
"has_sig": false,
"md5_digest": "c735c11c9c883955ea4c54ec4e18a616",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 26609,
"upload_time": "2023-01-10T12:52:17",
"upload_time_iso_8601": "2023-01-10T12:52:17.230265Z",
"url": "https://files.pythonhosted.org/packages/6e/e4/b879edebcfd7151fef7ed447e437188a7ff100b9965bcade547f0cd1e94b/pdok-geopackage-validator-0.8.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-10 12:52:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "pdok-geopackage-validator"
}