forked from MapComplete/MapComplete
Reformat all files with prettier
This commit is contained in:
parent
e22d189376
commit
b541d3eab4
382 changed files with 50893 additions and 35566 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import * as fs from "fs";
|
||||
import * as fs from "fs"
|
||||
|
||||
function main(args) {
|
||||
if (args.length < 2) {
|
||||
console.log("Given a single geojson file and an attribute-key, will generate a new file for every value of the partition.")
|
||||
console.log(
|
||||
"Given a single geojson file and an attribute-key, will generate a new file for every value of the partition."
|
||||
)
|
||||
console.log("USAGE: perProperty `file.geojson` `property-key`")
|
||||
return
|
||||
}
|
||||
|
|
@ -24,15 +26,14 @@ function main(args) {
|
|||
|
||||
const stripped = path.substr(0, path.length - ".geojson".length)
|
||||
perProperty.forEach((features, v) => {
|
||||
|
||||
fs.writeFileSync(stripped + "." + v.replace(/[^a-zA-Z0-9_]/g, "_") + ".geojson",
|
||||
fs.writeFileSync(
|
||||
stripped + "." + v.replace(/[^a-zA-Z0-9_]/g, "_") + ".geojson",
|
||||
JSON.stringify({
|
||||
type: "FeatureCollection",
|
||||
features
|
||||
}))
|
||||
features,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
main(process.argv.slice(2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue