forked from MapComplete/MapComplete
Export reviews as geojson
This commit is contained in:
parent
0f85a7b9b0
commit
e1f9604884
1 changed files with 16 additions and 0 deletions
|
@ -65,6 +65,7 @@ export default class GenerateReviewsAnalysis extends Script {
|
||||||
opinion: review.opinion,
|
opinion: review.opinion,
|
||||||
client: review.metadata.client_id,
|
client: review.metadata.client_id,
|
||||||
nickname: review.metadata.nickname,
|
nickname: review.metadata.nickname,
|
||||||
|
affiliated: "" + review.metadata.is_affiliated,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -78,12 +79,27 @@ export default class GenerateReviewsAnalysis extends Script {
|
||||||
type: "FeatureCollection",
|
type: "FeatureCollection",
|
||||||
features: geojsonFeatures,
|
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(
|
fs.writeFileSync(
|
||||||
"../MapComplete-data/reviews.geojson",
|
"../MapComplete-data/reviews.geojson",
|
||||||
|
|
||||||
JSON.stringify(fc),
|
JSON.stringify(fc),
|
||||||
{ encoding: "utf-8" }
|
{ encoding: "utf-8" }
|
||||||
)
|
)
|
||||||
|
fs.writeFileSync(
|
||||||
|
"../MapComplete-data/reviewsmc.geojson",
|
||||||
|
|
||||||
|
JSON.stringify(fcmc),
|
||||||
|
{ encoding: "utf-8" }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async main(args: string[]): Promise<void> {
|
async main(args: string[]): Promise<void> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue