Export reviews as geojson

This commit is contained in:
Pieter Vander Vennet 2023-01-22 03:02:58 +01:00
parent 0f85a7b9b0
commit e1f9604884

View file

@ -65,6 +65,7 @@ export default class GenerateReviewsAnalysis extends Script {
opinion: review.opinion,
client: review.metadata.client_id,
nickname: review.metadata.nickname,
affiliated: "" + review.metadata.is_affiliated,
},
})
} catch (e) {
@ -78,12 +79,27 @@ export default class GenerateReviewsAnalysis extends Script {
type: "FeatureCollection",
features: geojsonFeatures,
}
const fcmc: FeatureCollection = {
type: "FeatureCollection",
features: geojsonFeatures.filter(
(f) =>
f.properties.client.indexOf("mapcomplete") >= 0 ||
f.properties.client.indexOf("pietervdvn.github.io") >= 0
),
}
fs.writeFileSync(
"../MapComplete-data/reviews.geojson",
JSON.stringify(fc),
{ encoding: "utf-8" }
)
fs.writeFileSync(
"../MapComplete-data/reviewsmc.geojson",
JSON.stringify(fcmc),
{ encoding: "utf-8" }
)
}
async main(args: string[]): Promise<void> {