Skip to content

Instantly share code, notes, and snippets.

@wipfli
Created June 4, 2025 16:41
Show Gist options
  • Save wipfli/51474af4262c267d3f78bf69cb22ed9d to your computer and use it in GitHub Desktop.
Save wipfli/51474af4262c267d3f78bf69cb22ed9d to your computer and use it in GitHub Desktop.
pinmeto overture pmtiles
set -e
set -u
duckdb -c "
LOAD spatial;
SET s3_region='us-west-2';
COPY (
SELECT
'Feature' AS type,
json_object(
'type', 'Point',
'coordinates', [ST_X(geometry), ST_Y(geometry)]
) as geometry,
json_object(
'id', id,
'name', names.primary,
'confidence', confidence,
'socials', CAST(socials AS JSON)
) AS properties
FROM read_parquet('s3://overturemaps-us-west-2/release/2025-05-21.0/theme=places/type=place/*', filename=true, hive_partitioning=1)
WHERE list_has(list_transform(sources, x -> x.dataset), 'PinMeTo')
AND geometry IS NOT NULL
) TO STDOUT (FORMAT json);
" | tippecanoe -o pinmeto-places-2025-05-21.pmtiles --force -l place -rg --drop-densest-as-needed --extend-zooms-if-still-dropping --maximum-tile-bytes=2500000 --progress-interval=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment