Skip to content

Instantly share code, notes, and snippets.

@chapmanjacobd
Last active April 12, 2026 00:46
Show Gist options
  • Select an option

  • Save chapmanjacobd/c74f3d53186aa5b437252451f50de6be to your computer and use it in GitHub Desktop.

Select an option

Save chapmanjacobd/c74f3d53186aa5b437252451f50de6be to your computer and use it in GitHub Desktop.
OSM planet.pbf to Wikipedia POIs
osmium tags-filter planet-260330.osm.pbf /wikipedia -o wikipedia_pois.osm.pbf
# (one hour)
osmium export wikipedia_pois.osm.pbf -f jsonseq --format-option=print_record_separator=false | \
jq -sc 'group_by(.properties.wikipedia) | map(max_by(.properties | length)) | sort_by(.properties | length) | reverse[]' \
> grouped_by_wikipedia.geojsonl
# (six hours)
# .rw-r--r--@ 9.7G xk 9 Apr 16:09 grouped_by_wikipedia.geojsonl
rm -f wikipedia_pois.osm.pbf
go install github.com/chapmanjacobd/computer/bin/centroidify@latest
centroidify grouped_by_wikipedia.geojsonl wikipedia.POIs.geojson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment