This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/usr/bin/env bash | |
| ogrinfo "data/TOP10NL_45W.gpkg" -sql "select * from Terrein where Intersects(GeomFromGPB(geom), MakePoint(155357,405815))" | |
| ogrinfo points.gpkg -sql "select * from beheer_leiding where Intersects(GeomFromGPB(geometry), MakeLine(MakePoint(80034.6,452005.1,28992), MakePoint(80034.6,453965.8,28992)))" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu | |
| PROGRAM_NAME="$0" | |
| if [ $# -ne 1 ]; then | |
| echo "description: generate AccessConstraint field for OGC Service Capabilities documents based on service/dataset metadata" | |
| echo " usage: ${PROGRAM_NAME} <metadata_identifier>" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pre.CodeMirror-line { | |
| background: linear-gradient(to right, transparent 80ch,#f7f6e5 80ch) content-box !important; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Minio - remove files recursively in path (older than specific date, optional) | |
| function mc-rm-older-than(){ | |
| local s3_conn_path="$1" | |
| local date="$2" | |
| local no_dry_run="$3" | |
| if [[ $# -lt 2 ]]; then | |
| fun_name=${FUNCNAME[0]} | |
| if [[ -z $fun_name ]];then | |
| fun_name=${funcstack} # for zsh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # example call | |
| # ./gpkg-empty-ft-table.sh test.gpkg test '{ | |
| # "fid":"INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL", | |
| # "geom":"MULTIPOLYGON", | |
| # "gml_id": "TEXT NOT NULL", | |
| # "type": "TEXT", | |
| # "object_id": "TEXT", | |
| # "geometrie_id": "TEXT", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import http.server | |
| import os.path | |
| import argparse | |
| def file_path(string): | |
| if os.path.isfile(string): | |
| return string | |
| else: | |
| raise FileNotFoundError(string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Bash script for scraping WFS services in a responsible way. Script divides in area of interest in list of bounding boxes, which are requested sequentially. The HTTP get request is configured to retry, using the default CURL exponential backoff algorithm. | |
| # Only use when no bulk download (like ATOM) service is available. | |
| set -eu | |
| TARGET_GPKG=output.gpkg | |
| WFS_URL="https://service.pdok.nl/prorail/spoorwegen/wfs/v1_0" | |
| FT_NAME=spoorwegen:kilometrering | |
| LAYER_NAME=$(cut -d":" -f2 <<<$FT_NAME) | |
| SLEEP=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -eu | |
| awk ' | |
| { | |
| if ($0 ~ /^\s*<gwsw:beheer_leiding>$/) | |
| { | |
| cmd = "uuidgen" | |
| cmd | getline uuid | |
| print ("<gwsw:beheer_leiding gml:id=\"" uuid "\">") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Commandline tool to convert ISO(19119 and 19139) metadata to DCAT-AP based on https://github.com/SEMICeu/iso-19139-to-dcat-ap. | |
| Requires: lxml | |
| Usage: `./iso2dcat.py --help` | |
| """ | |
| from lxml.etree import XML, XSLT, tostring | |
| from urllib.request import urlopen | |
| import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Minimal CLI tool to validate XML (supplied either by file or url) against schema definition | |
| """ | |
| import argparse | |
| from urllib.request import urlopen | |
| from lxml.etree import XMLSchema, XML | |
| def main(xml, xsd): | |
| schema = XMLSchema(file=xsd) |