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.
Users
Known users of this spider are:
- PDOK, used to provision several geo viewers
- PDOK services QGIS plugin, by rduivenvoorde
Build and run
To install from source run (from the root this repo):
python3 -m pip install -e .
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 run the following:
ngr-spider layers -p 'OGC:WMS,OGC:WMTS,OGC:API features' pdok-services.json
ngr-spider services -p 'OGC:WMS,OGC:WMTS,OGC:API features' pdok-services.json
Note: you may need to install pyproj manually (pip install pyproj) on some systems.
Development
Install dev dependencies and package from source:
python3 -m pip install -e ".[dev]"
To format code install black en run from the root of this repo:
black .
Delete unused imports with autoflake:
autoflake --remove-all-unused-imports -i -r .
Organise and order imports with isort:
isort -m 3 .
Run mypy for type checking (from root):
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"] }
]
Release files for ngr-services-spider 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ngr_services_spider-0.7.1.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ngr_services_spider-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.1 kB
Release files / ngr_services_spider-0.7.1.tar.gz
| Download URL | ngr_services_spider-0.7.1.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d045034edb43f22fae81a53e666c254121ab5e8927a532f8ed2ba431bbc73e8b
|
|
BLAKE2b-256 checksum How to use checksums |
6b692066649e4b64cebbc47264a54f239912335d1536bc6baf1f96f43e876fa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / ngr_services_spider-0.7.1-py3-none-any.whl
| Download URL | ngr_services_spider-0.7.1-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d80910c4319412cf86550f80eaea16c2dc0829e7972b25ecf1ffb9daa0b75be6
|
|
BLAKE2b-256 checksum How to use checksums |
2ff957ed351b10a7e966bf05f391d63986200255edbd74cecc64bcea9fcdeb45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|