Coder Social home page Coder Social logo

pdok / ngr-services-spider Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 1.0 139 KB

CLI app to retrieve list of services and datasets in a simple JSON format from nationaalgeoregister.nl

License: MIT License

Python 99.59% Dockerfile 0.41%
owslib python3 ngr pdok csw

ngr-services-spider's Introduction

NGR SPIDER

GitHub license GitHub release Docker Build PyPi Build

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 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

  1. To generate a list of layers per service run the following:
ngr-spider layers -p 'OGC:WMS,OGC:WMTS' pdok-services.json
ngr-spider services -p 'OGC:WMS,OGC:WMTS' pdok-services.json

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"] }
]

ngr-services-spider's People

Contributors

arbakker avatar kad-korpem avatar kad-rothul avatar kad-velsl avatar rahmabpublic avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

creativename123

ngr-services-spider's Issues

Functionaliteit OGC:API features correct maken & testen

Doel:

De ngr-spider (https://github.com/PDOK/ngr-services-spider) aanpassen om ook voor OGC API features de juist info van een records via de CSW (Catalogue Service for the Web)

Beschrijving:

De implementatie voor het ophalen van ogcapi features moet uitgebreid worden. Er zijn op dit moment (22-08-2023) nog geen features records in het NGR om de implementatie te testen: Er is slechts een layout gemaakt met 'lege'-functies en TODO's die in dit ticket aangevuld moeten worden. Deze uitbreiding kan gedaan worden zodra PDOK een features service gaat ontsluiten conform OGCAPI features.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.