1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// investigate how to load duckdb with spatial extensions in this context in order to load buildings from s3.
export const untitled_limeHornet = (async () => {
COPY(
SELECT,
type,
subType,
localityType,
adminLevel,
isoCountryCodeAlpha2,
JSON(names),
AS,
names,
JSON(sources),
AS,
sources,
ST_GeomFromWkb(geometry),
AS,
geometry,
FROM,
read_parquet(
"s3://overturemaps-us-west-2/release/2023-07-26-alpha.0/theme=admins/type=*/*",
filename = true,
hive_partitioning = 1,
),
WHERE,
adminLevel = 2,
AND,
ST_GeometryType(ST_GeomFromWkb(geometry)),
IN("POLYGON", "MULTIPOLYGON"),
);
TO;
"countries.geojson";
WITH(FORMAT, GDAL, DRIVER, "GeoJSON");
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023