Skip to content

Instantly share code, notes, and snippets.

View thisisaaronland's full-sized avatar

Aaron Straup Cope thisisaaronland

View GitHub Profile

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

$> 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 (
@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"