From e9011b00e6e6b9c19fd921127dcdc2d85f40a996 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 27 Jan 2025 04:00:51 +0100 Subject: [PATCH] Scripts: prune resources --- scripts/downloadCommunityIndex.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/downloadCommunityIndex.ts b/scripts/downloadCommunityIndex.ts index 7d32e2a29d..679a4b4254 100644 --- a/scripts/downloadCommunityIndex.ts +++ b/scripts/downloadCommunityIndex.ts @@ -90,12 +90,12 @@ class DownloadCommunityIndex extends Script { const clipped = GeoOperations.clipAllInBox(features, tileIndex) if (clipped.length === 0) { skipped++ - features.push(Tiles.asGeojson(tileIndex)) - writeFileSync(`${targetDirectory + tileIndex}_skipped.geojson`, JSON.stringify({ - type: "FeatureCollection", features - })) continue } + for (const f of clipped) { + f.properties.resources = DownloadCommunityIndex.stripResourcesObj(f.properties.resources) + } + const [z, x, y] = Tiles.tile_from_index(tileIndex) const path = `${targetDirectory}/tile_${z}_${x}_${y}.geojson` clipped.forEach((f) => {