Skip to content

Instantly share code, notes, and snippets.

@danabauer
Last active February 21, 2024 16:41
Show Gist options
  • Save danabauer/62bab89bcf266a0cb20f73fcb34d671a to your computer and use it in GitHub Desktop.
Save danabauer/62bab89bcf266a0cb20f73fcb34d671a to your computer and use it in GitHub Desktop.
extract data Overture buildings theme
COPY (
SELECT
id,
theme,
type,
version,
level,
updateTime,
height,
numFloors,
class,
JSON(names) AS names,
JSON(sources) AS sources,
ST_GeomFromWkb(geometry) AS geometry
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-01-17-alpha.0/theme=buildings/type=*/*', filename=true, hive_partitioning=1)
WHERE
bbox.minx > -79.938171
AND bbox.maxx < -79.922957
AND bbox.miny > 32.782061
AND bbox.maxy < 32.794544
LIMIT 10
)
TO 'buildings_charleston.geojson'
WITH (FORMAT GDAL, DRIVER 'GeoJSON', SRS 'EPSG:4326');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment