Skip to content

Instantly share code, notes, and snippets.

View tordans's full-sized avatar

Tobias tordans

View GitHub Profile
@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 May 20, 2026 09:34
LLM Technology Stack

General tech stack

  • Runtime / build: Bun, latest Vite (8+), add minimumReleaseAge of 5 days
  • UI: React 19
  • Lint/format: oxlint and oxfmt with "fix"-flags. with Prettier Default plus Class sorting, Import sorting, package.json-Sorting, lineWidth 100, strict switch-case, semicolons asNeeded, single quotes
  • Data: tanstack.com/query, TanStack Form (for non-trivial forms)
  • Routing: TanStack Router
  • State: Zustand (tkdodo) for global State; URL state via Tanstack Router (validated with Zod) or, if no Tanstack Router, then via nuqs with one hook file per state
  • Styling: Tailwind CSS, @tailwindcss/forms, @tailwindcss/typography, tailwind-merge with twJoin, twMerge
  • Fonts: Fontsource imports
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",
@tordans
tordans / index.html
Last active May 10, 2024 15:36
iD Editor Preset Preview Experiment
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>iD Test</title>
<link rel="stylesheet" href="dist/iD.css" />
<link
rel="icon"
type="image/png"
href="data:image/png;base64,iVBORw0KGgo="