Skip to content

Instantly share code, notes, and snippets.

View thisisaaronland's full-sized avatar

Aaron Straup Cope thisisaaronland

View GitHub Profile
@thisisaaronland
thisisaaronland / fetch-wof.sh
Last active August 29, 2025 23:56
fetch-wof.sh
#!/bin/sh
# git clone https://github.com/whosonfirst/wof-cli.git
# cd wof-cli
# make cli
# Note that you could skip the 'wof repos' step entirely and simply do this:
# ./bin/wof emit -format geojson -iterator-uri githuborg:///tmp 'whosonfirst-data://?prefix=whosonfirst-data-admin-'
# which will take a very long time and will not be terribly forgiving of errors (network, etc.)
@thisisaaronland
thisisaaronland / gist:7778bf36ca1621911899b83a93185d8b
Last active August 25, 2025 05:22
Create new "did:plc:" DID (Go)
package did
import (
"crypto/ed25519"
"crypto/rand"
"crypto/sha256"
"encoding/base32"
"encoding/base64"
"encoding/json"
"fmt"
@thisisaaronland
thisisaaronland / gist:576b014218548123f6ae147cee12c059
Created August 21, 2025 19:48
Example "standard places result" ATProto lexicon for places. This is for demonstration/discussion purposes only.
{
"$schema": "https://atproto.com/lexicon/1.0/schema",
"id": "app.bsky.place#standardPlacesResult",
"name": "StandardPlacesResult",
"description": "A record that contains common metadata associated with a place.",
"defs": {
"app.bsky.place#standardPlacesResult": {
"type": "object",
"required": [
"id",
@thisisaaronland
thisisaaronland / gist:55061c8a4c0f0618be58531436540002
Created July 27, 2023 21:53
Exporting Overture places parquet databases to GeoJSONSeq files
#!/bin/sh
# This assumes that you have installed duckdb and that both /usr/local/data/overture/places and
# /usr/local/data/overture/places-geojson exist and that the Overture "places" parquet files have
# been downloaded in to the former. See also: https://github.com/OvertureMaps/data#3-duckdb-sql
for f in /usr/local/data/overture/places/*
do
f=`basename $f`
echo "process $f"
$> git clone [email protected]:whosonfirst-data/whosonfirst-data-admin-gb.git /usr/local/data/whosonfirst-data-admin-gb
$> cd /usr/local/whosonfirst/go-whosonfirst-sqlite-features-index
$> ./bin/wof-sqlite-index-features -dsn /usr/local/data/gb.db -timings -spatial-tables /usr/local/data/whosonfirst-data-admin-gb
Then in `cmd/test/main.go`:
```
package main
import (

Existential flags

There are currently (5) existential flags for WOF documents that map to the "standard places response" (SPR) interface. The SPR is meant to be a minimum common response for all services that provide a public interface for accessing WOF documents.

The SPR itself remains to be fully and properly documented.

Existential flags can be used to filter records on ingest. For example the go-whosonfirst-pip-v2 package allows you to filter records to index by one or more existential flags:

https://github.com/whosonfirst/go-whosonfirst-pip-v2/blob/master/app/indexer.go#L98-L175