Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
eyr1n committed Sep 19, 2024
1 parent a1454d4 commit b038e0e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@ const GeoJSON = z.object({
}),
});

const features = (
await Promise.all(
(
await glob(join(import.meta.dirname, 'buildings/*.geojson'))
).map(async (path) => {
const features = await Promise.all(
(await glob(join(import.meta.dirname, 'buildings/*.geojson'))).map(
async (path) => {
const geojson = await readFile(path)
.then((res) => res.toString())
.then((res) => JSON.parse(res));
return GeoJSON.parse(geojson);
}),
)
).filter((feature) => feature.properties.children.length > 0);
},
),
); /* .filter((feature) => feature.properties.children.length > 0); */

await writeFile(
join(import.meta.dirname, 'public/buildings.geojson'),
Expand Down

0 comments on commit b038e0e

Please sign in to comment.