Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelvandenBerg committed Oct 11, 2024
1 parent 135c18c commit 9e34188
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,41 @@ Options:
--help Show this message and exit.
```

### Generate geopackage from table definitions

```bash
geopackage-validator generate-gpkg --help
Usage: geopackage-validator generate-gpkg [OPTIONS]
Generate an empty geopackage based on a geopackage validator table
definition. Provide the table definitions with the --table-definitions-path
parameter. The generated geopackage will be valid except for the fact that
it will be empty.
Options:
--gpkg-path PATH 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)
[required]
--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]
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO or
DEBUG
--yaml Output yaml
--validate Validate after generation
--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.
Expand Down
15 changes: 2 additions & 13 deletions geopackage_validator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,19 +420,8 @@ def geopackage_validator_command_generate_table_definitions(
name="generate-gpkg",
help=(
"Generate an empty geopackage based on a geopackage validator table definition. Provide the table definitions "
"with the --table-definitions-path parameter. The generated geopackage will be valid except for the fact that it"
"will be empty.\n\n"
"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.\n\n"
"Examples:\n\n"
"viscurl:\n\n"
"geopackage-validator generate-definitions --gpkg-path /vsicurl/http://minio-url.nl/bucketname/key/to/public.gpkg\n\n"
"vsis3:\n\n"
"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\n\n"
"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\n\n"
"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"
"with the --table-definitions-path parameter. The generated geopackage will be valid except for the fact that "
"it will be empty."
),
)
@click.option(
Expand Down

0 comments on commit 9e34188

Please sign in to comment.