Skip to content

Instantly share code, notes, and snippets.

View knudmoeller's full-sized avatar

Knud Möller knudmoeller

View GitHub Profile
@knudmoeller
knudmoeller / campsites.geojson
Last active June 17, 2025 21:53
Campingplätze Niederlnde
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knudmoeller
knudmoeller / 20250213-dataset_with_resources_fisbriker.berlin.de.txt
Created February 13, 2025 21:30
Datasets with resources in fbinter.stadt-berlin.de (but not in gdi.berlin.de)
https://daten.berlin.de/datensaetze/20-grune-hauptwege-wanderkarte-wfs-99a22ff0
https://daten.berlin.de/datensaetze/20-grune-hauptwege-wanderkarte-wms-1f028343
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-1-lod-1-atom-e2a1e24e
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-2-lod-2-atom-3c7c49af
https://daten.berlin.de/datensaetze/3d-gebaudemodelle-im-level-of-detail-2-lod-2-wms-f2a8a483
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wfs-6185b5fb
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wms-e45c2176
https://daten.berlin.de/datensaetze/adressen-berlin-wfs-634ab8ba
https://daten.berlin.de/datensaetze/adressen-berlin-wms-130748fb
https://daten.berlin.de/datensaetze/adressen-im-inspire-datenmodell-atom-3bd15407
@knudmoeller
knudmoeller / 20250213-dataset_with_resources_gdi.berlin.de.txt
Created February 13, 2025 16:10
Datasets with resources in gdi.berlin.de
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wfs-6185b5fb
https://daten.berlin.de/datensaetze/abstellflachen-fur-mikromobilitatsangebote-wms-e45c2176
https://daten.berlin.de/datensaetze/adressen-berlin-wfs-634ab8ba
https://daten.berlin.de/datensaetze/adressen-berlin-wms-130748fb
https://daten.berlin.de/datensaetze/adressen-im-inspire-datenmodell-wms-ee802686
https://daten.berlin.de/datensaetze/adressen-regionales-bezugssystem-rbs-wfs-c43966c4
https://daten.berlin.de/datensaetze/adressen-regionales-bezugssystem-rbs-wms-d1c67d30
https://daten.berlin.de/datensaetze/afis-berlin-wfs-1408ef18
https://daten.berlin.de/datensaetze/afis-berlin-wms-c4897b9f
https://daten.berlin.de/datensaetze/alkis-berlin-bezirke-wfs-ced31d7d
@knudmoeller
knudmoeller / ckan_installation.md
Last active January 29, 2024 08:57
CKAN 2.9.10: "Installing from Source" on Ubuntu 20.04 + "Deploying a source install"

Installing CKAN from Source + Deployment

The installation instructions on https://docs.ckan.org/en/2.9/maintaining/installing/install-from-source.html are fine, except:

Solr

  • I don't install Solr locally on the same machine, so I don't need to install Solr, Jetty or Java. Installing the required packages is therefore done like this:
$ sudo apt-get install python3-dev postgresql libpq-dev python3-pip python3-venv git-core redis-server
@knudmoeller
knudmoeller / get_geojson.md
Last active October 30, 2024 20:00
Get WGS84-GeoJSON from WFS with Soldner-Coordinates

Get WGS84-GeoJSON from WFS with Soldner-Coordinates

The problem: get GeoJSON data from a WFS that uses a projection other than WGS84. This is e.g. true for all geo data in Berlin's FIS-Broker GIS. The data there uses the "Soldner" projection (or EPSG:25833).

Download as XML

@knudmoeller
knudmoeller / planets_and_moons.rq
Created January 17, 2023 23:21
Wikidata Query to get all planets of the solar system (and Pluto) and their moons
# Planets of the solar system
SELECT DISTINCT ?planet ?planetLabel ?child ?childLabel
WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
{
# things that are instances of planets (or subclasses thereof)
# and are part of the solar system (or parts of parts)
?planet wdt:P31/wdt:P279* wd:Q634 .
@knudmoeller
knudmoeller / wordle_filter.py
Last active January 14, 2022 11:22
Wordle Filter
import subprocess
# read the dictionary file:
result = subprocess.run(['egrep', '^.{5}$', "/usr/share/dict/words"], stdout=subprocess.PIPE)
words = result.stdout.decode('utf-8').splitlines()
present = ['a', 'n', 'g', 't'] # letters that we know are in the word
not_present = ['o', 'i', 's', 'e', 'u'] # letters we know are not in the word
# filter words with all() and not any()
  • Input data are multiple json files in sorted/ with this minimal structure:
{
  "dump_finished": "2021-12-14T10:43:42+01:00",
  "datasets": [
    ...
  ]
}
@knudmoeller
knudmoeller / jq_multi_query.sh
Created December 21, 2021 13:59
Query multiple files with jq, slurp results into one large array
jq "{date: .dump_finished, count: .datasets | length}" sorted/*.json | jq -s
@knudmoeller
knudmoeller / bulk_purge.py
Created November 18, 2021 08:57
Bulk-purging Datasets in CKAN with ckanapi
from ckanapi import RemoteCKAN
import os
# require ckanapi: https://github.com/ckan/ckanapi
package_names = [
"versickerung-aus-niederschlagen-2017-umweltatlas-wfs-beb56dfa",
"versickerung-aus-niederschlagen-ohne-versiegelung-2017-umweltatlas-wfs-e4a931f6",
"versiegelung-2005-unkorrigierte-versiegelungsgrade-rasterdaten-atom-451f714b",
"versiegelung-2011-unkorrigierte-versiegelungsgrade-rasterdaten-atom-c973b948",