Skip to content

Instantly share code, notes, and snippets.

View arbakker's full-sized avatar

Anton Bakker arbakker

  • Kadaster
  • Apeldoorn
View GitHub Profile
@arbakker
arbakker / gpkg-cc-2-sc.ps1
Created December 13, 2024 09:29
Convert GeoPackage tablenames and columnnames from CamelCase to snake_case #powershell #gpkg #ogr2ogr
<#
.SYNOPSIS
Convert GeoPackage tablenames and columnnames from CamelCase to snake_case.
.DESCRIPTION
Script to convert GeoPackage tablenames and columnnames from CamelCase to snake_case. Can be useful when exporting INSPIRE compliant datasets to GeoPackage.
.PARAMETER inputGPKG
Input GeoPackage to convert from CamelCase to snake_case
.PARAMETER outputGPKG
Output GeoPackage (will be overwritten if exists)
#>
@arbakker
arbakker / nsgi-coordinates-trans-api.bas
Created December 6, 2024 13:35
NSGI coordinate transformation call from Excel [WIP] #vba #api #excel #nsgi
Public Function CFormat(ParamArray arr() As Variant) As String
Dim i As Long
Dim temp As String
temp = CStr(arr(0))
For i = 1 To UBound(arr)
myVal = arr(i)
If IsNull(myVal) Then
myVal = "null"
End If
@arbakker
arbakker / README.md
Last active November 28, 2024 10:56
NSGI Coordinate Transformation API Office Script - for transforming coordinates in MS Excel

NSGI Coordinate Transformation API in Excel

Zie MS Excel bestand: office-script-ct-api.xlsx voor hoe het script te gebruiken (script is al geincludeerd in xlsx bestand).

Om te gebruiken open het transformeer tabblad en klik op de transformeer knop.

@arbakker
arbakker / headers.js
Created May 8, 2024 06:42
NGINX Log Headers
// /etc/nginx/headers.js
function headers_json(r) {
return JSON.stringify(r.headersIn)
}
export default {headers_json};
@arbakker
arbakker / script.sh
Created January 5, 2024 15:47
yq add fields to objects in array
yq -P < src/coordinate_transformation_api/assets/config.yaml '{"crs": [.crs | to_entries | .[] | .value.uri="http://www.opengis.net/" + (.key | split(":") | join("/0/"))] | from_entries}'
@arbakker
arbakker / pdok-download-api-full-custom.py
Created November 30, 2023 11:53
Python CLI for creating full custom downloads on the PDOK download API
import requests
import json
import time
import os
import pathlib
import argparse
from urllib.parse import urlparse
def main(api_url, featuretypes, format, bbox_rd=None, geofilter=None):
@arbakker
arbakker / LICENSE
Created June 21, 2023 08:07
This license applies to all public gists https://gist.github.com/arbakker
MIT License
Copyright (c) 2023 Anton Bakker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@arbakker
arbakker / get-percelen-met-adres.sh
Last active June 21, 2023 08:06
Bash script voor het ophalen van percelen uit de Kadastrale Kaart WFS aan de hand van een adres, met behulp van de PDOK Locatieserver #jq #pdok #WFS #bash #
#!/usr/bin/env bash
# Bash script voor het ophalen van percelen uit de Kadastrale Kaart WFS aan de hand van een adres, met behulp van de PDOK Locatieserver
# Author: [email protected]
# Dependencies:
# - python3
# - jq
# - xmllint (libxml2-utils)
# - curl
set -euo pipefail
@arbakker
arbakker / _README.md
Created June 16, 2023 11:39
PDOK MapServer docker-compose voorbeeld

PDOK MapServer docker-compose voorbeeld

MapServer docker-compose voorbeeld met lighttpd reverse-proxy, voor het toevoegen van response headers.

  1. Start docker-compose met:
docker-compose up
  1. Service draait nu op: http://localhost/mapserver?service=WMS&amp;request=getcapabilities

% Habits % John Doe % March 22, 2005

In the morning

Getting up

  • Turn off alarm
  • Get out of bed