Skip to content

Instantly share code, notes, and snippets.

View tordans's full-sized avatar

Tobias tordans

View GitHub Profile

OSMnexus by Laurenz

Laurenz has built a new Rust-based tool called OSMnexus for processing OpenStreetMap data. It takes a PBF file as input, for example a Germany extract, and processes it according to a JSON configuration. In its current form, the Germany dataset can be processed in about 10 minutes.

The configuration reflects the logic of Tilda Geo, especially for cycling infrastructure. This makes interactive workflows possible: the tool could run on a server, a user could define a bounding box in the browser, edit the configuration live, rerun the processing, and receive updated results for that area within a few minutes.

An advantage of the tool is that it supports both OSM feature extraction and graph creation. Because it splits ways at intersections, it can generate graph-ready data for routing or network analysis. The implementation was developed against Tilda’s cycling infrastructure data as a reference and iterate

@tordans
tordans / bench-presets.json
Last active May 9, 2026 20:04
Example custom preset (presets_url=) and validation rules (maprules=) for iD
{
"presets": {
"amenity/bench_with_backrest": {
"icon": "temaki-bench",
"geometry": ["point"],
"tags": { "amenity": "bench", "backrest": "yes" },
"addTags": { "amenity": "bench", "backrest": "yes" },
"fields": ["inscription", "material", "seats", "colour"],
"name": "Bench with Backrest",
"terms": ["bench", "seat", "backrest"]

Building type comparison: StreetComplete, OSM Wiki (Wikibase), iD Tagging Schema

Four columns: StreetComplete, OSM Wiki (Wikibase), iD preset, iD building field. Rows include SC building types plus iD presets/field options not in SC.

name: Abandoneddesc: unused building whose original function or purpose is unknowntag: abandoned=yesiconTagdesc: Man-made features that have been abandoned by their owner, but which are still useful for navigation and visible in the landscape. Imm
StreetCompleteOSM WikiiD presetiD building field
@tordans
tordans / tech-stack.md
Last active June 14, 2026 04:41
LLM Technology Stack for geo-heavy React SPAs.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
osm_id
8772187
25000495
26740055
23116736
23984495
24341604
24031704
23053706
23429724
@tordans
tordans / outline.md
Created May 12, 2025 21:01
Code for Berlin 2025-05-12 OSM "Was gibt es neues in der OSM- und Geo-Community"

Notizen zu "Was ist in den letzten 12 Monaten in OSM passiert in Berlin und in Deutschland" https://www.meetup.com/ok-lab-berlin/events/307692190

@tordans
tordans / geojsonToPoly.test.ts
Created May 7, 2025 08:09
Modernized version of https://github.com/gagan-bansal/geojson2poly that can be used in a typescript file. It returns the poly fine as a string based on a input GeoJson.
import { describe, expect, it } from 'bun:test'
import type { Feature, FeatureCollection, Polygon } from 'geojson'
import { geojsonToPoly } from './geojsonToPoly'
describe('geojsonToPoly', () => {
it('should convert a simple Polygon GeoJSON to a polyline string', () => {
const geojson: Feature<Polygon, {}> = {
type: 'Feature',
properties: {},
geometry: {
@tordans
tordans / maplibre-number-formatting.js
Created February 3, 2024 11:23
Maplibre GL JS number formatting snipped
// Source https://osmus.slack.com/archives/C01G3D28DAB/p1706567778474359?thread_ts=1706534773.353969&cid=C01G3D28DAB
"text-field": [
"let",
"thousands",
["floor", ["/", ["get", "length_m"], 1000]],
[
"let",
"reminder",
[
@tordans
tordans / add-use-client-to-all-files.cjs
Created October 11, 2023 08:01
Quick helper script to add `use client` to all ts/tsx files in all folders except when it was added already. (Thanks to Github Copilot for creating this.)
// 0. Stash everything in git to have a clean slate
// 1. Update `folderPath`
// 2. Run with `node add-use-client-to-all-files.cjs` from the root of your project
const fs = require('fs')
const path = require('path')
const folderPath = './src/app' // Replace with the path to your folder
function updateFilesInFolder(folderPath) {
{
"#": "This JSON file is a small template to get you started developing a theme",
"#": "All lines starting with '#' are comments and can be removed in the theme if you don't need the explanation anymore",
"#": "Make sure to join our chat channel at https://app.element.io/#/room/#MapComplete:matrix.org for questions, sharing your theme, ...",
"#": "To actually load your theme: on linux: run a local webserver (e.g. `webfsd`) and go to https://mapcomplete.osm.be/theme?userlayout=http://127.0.0.1:8080/path-to-your-theme.json",
"#": "If you don't know how to run a webserver: go to https://www.base64encode.org/ , copy paste this entire document in the 'encode' field and encode it;",
"#": "Then, go to https://mapcomplete.osm.be/theme?userlayout=true#your-base64-encoded-file",
"id": "crossing",
"maintainer": "Crossing",