Skip to content

Instantly share code, notes, and snippets.

View mvexel's full-sized avatar

Martijn van Exel mvexel

View GitHub Profile
-- Define shops table
local shops = osm2pgsql.define_table({
name = 'shops',
ids = {
type = 'any',
id_column = 'osm_id',
type_column = 'osm_type'
},
columns = {
{
-- Define shops table
local poi = osm2pgsql.define_table({
name = 'poi',
ids = {
type = 'any',
id_column = 'osm_id',
type_column = 'osm_type'
},
columns = {{
column = 'name',
#!/usr/bin/env python
# Load taginfo CSVs and generate mappings.json
import json
import httpx
TAGINFO_PRIMARY_KEYS_URL = "https://taginfo.openstreetmap.org/api/4/key/values?key={key}&filter=all&lang=en&sortname=count&sortorder=desc&rp=100&page=1"
TAGINFO_COMBINATIONS_URL = "https://taginfo.openstreetmap.org/api/4/tag/combinations?key={key}&value={value}&filter=all&sortname=to_count&sortorder=desc&rp=19&page=1"
key value lookup
amenity fuel automotive
amenity parking_entrance automotive
amenity charging_station automotive
amenity car_wash automotive
amenity taxi automotive
amenity ferry_terminal automotive
shop car_repair automotive
shop car automotive
shop car_parts automotive
@mvexel
mvexel / gist:fbd6e20b5edaaaddf30480c216f82039
Last active November 7, 2025 17:42
overture places counts bucketed by confidence
D SELECT
confidence_bucket,
place_count,
ROUND(100.0 * place_count / SUM(place_count) OVER (), 2) AS percentage,
ROUND(100.0 * SUM(place_count) OVER (ORDER BY confidence_bucket DESC) / SUM(place_count) OVER (), 2) AS pct_at_or_above
FROM (
SELECT
FLOOR(confidence * 10) / 10 AS confidence_bucket,
COUNT(*) AS place_count
FROM read_parquet('s3://overturemaps-us-west-2/release/2025-10-22.0/theme=places/type=place/*')
#!/usr/bin/env python3
"""
Photo sorting script that organizes photos by camera/model and then by year/month
based on EXIF data.
"""
import os
import shutil
import argparse
import logging
import csv
import requests
mr_challenge_list_endpoint = "https://maproulette.org/api/v2/challenges?limit={limit}&page={page}"
mr_challenge_endpoint = "https://maproulette.org/api/v2/challenge/{id}"
page = 0
limit = 100
instr_list = []
#!/bin/bash
DIR=~/osm/data/us-cities/
for city in austin charlotte chicago columbus dallas denver fort_worth houston indianapolis jacksonville los_angeles new_york_city philadelphia phoenix san_antonio san_diego san_francisco san_jose seattle washington_dc; do
echo "Processing $city (file $DIR${city}.osm.pbf)"
osmium tags-filter --overwrite -o $DIR${city}-just-freeways.osm.pbf $DIR${city}.osm.pbf w/highway=motorway,motorway_link,trunk,trunk_link
osmium cat --overwrite -o $DIR${city}-just-freeway-nodes.osm.pbf $DIR${city}-just-freeways.osm.pbf -t node
done
{
"extracts": [
{
"output": "new_york_city.osm.pbf",
"output_format": "pbf",
"description": "New York City, NY",
"bbox": {
"left": -74.2591,
"bottom": 40.4774,
"right": -73.7004,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.