test
Project description
NGR SPIDER
CLI (command line interface) application to retrieve list of services and datasets in a simple JSON format from nationaalgeoregister.nl (NGR), leveraging the NGR CSW service.
To install from source run (from the root this repo):
python3 -m build
python3 -m pip install dist/ngr_spider-0.0.1-py3-none-any.whl
This should install the cli tool ngr-spider
:
$ ngr-spider
usage: ngr-spider [-h] subcommand ...
Generate list of PDOK services and/or service layers
positional arguments:
subcommand
services Generate list of all PDOK services
layers Generate list of all PDOK layers
options:
-h, --help show this help message and exit
Examples
- To generate a list of layers per service per dataset run the following:
ngr-spider layers -p OGC:WMS,OGC:WMTS -m datasets pdok-services.json
Run Type Check
Install package from source with dev dependencies:
python3 -m pip install -e ".[dev]"
Then run mypy for type checking (from root):
python3 -m mypy ngr_spider
Sorting Rules Example
When running the layers
command in flat mode (--mode flat
), it is possible to sort the layers in the output by passing a path to a JSON file containing, sorting rules. See below for an example a sorting rules JSON file (use for example with: ngr-spider layers --sort sorting-rules.json -n 20 -m flat --pretty -p "OGC:WMS,OGC:WMTS" output.json
):
[
{ "index": 0, "names": ["opentopo+"], "types": ["OGC:WMTS"] },
{ "index": 10, "names": ["^actueel_orthohr$"], "types": ["OGC:WMTS"] },
{ "index": 11, "names": ["^actueel_ortho25$"], "types": ["OGC:WMTS"] },
{ "index": 12, "names": ["^actueel_ortho25ir$"], "types": ["OGC:WMTS"] },
{ "index": 12, "names": ["lufolabels"], "types": ["OGC:WMTS"] },
{
"index": 20,
"names": ["landgebied", "provinciegebied", "gemeentegebied"],
"types": ["OGC:WFS"]
},
{ "index": 30, "names": ["top+"], "types": ["OGC:WMTS"] },
{
"index": 32,
"names": ["^standaard$", "^grijs$", "^pastel$", "^water$"],
"types": ["OGC:WMTS"]
},
{
"index": 34,
"names": ["bgtstandaardv2", "bgtachtergrond"],
"types": ["OGC:WMTS"]
},
{ "index": 60, "names": ["ahn3+"], "types": ["OGC:WMTS"] }
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ngr-services-spider-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d23c0bccb2296ab99b650a8f67c943474bef1a3c582cfd8252b6825c6c0edf26 |
|
MD5 | 693bb2afec2a71e7930d5e30f8e25218 |
|
BLAKE2b-256 | 56a1adc8ad1c173c3a0f88c2f672aeeda2fe86071c4b857bb14e023dbcd3d4ec |
Hashes for ngr_services_spider-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb3bf859b5796e9b93e6da1f120650a082b2f12323b2a7b99142c4fd2f9021e |
|
MD5 | 709bb613c7cdbaa32f4efa12b155f660 |
|
BLAKE2b-256 | 905ae74fd0010a6785811edaa0f76f2b0fc8fe721681bbf5b8cc5ff6778e6a27 |