forked from MapComplete/MapComplete
Themes(benches): improve openbenches support
This commit is contained in:
parent
e456e61ebf
commit
8212faa6e5
5 changed files with 21 additions and 15 deletions
|
@ -14,6 +14,7 @@ import OsmChangeAction from "../../src/Logic/Osm/Actions/OsmChangeAction"
|
|||
import ChangeTagAction from "../../src/Logic/Osm/Actions/ChangeTagAction"
|
||||
import { Tag as OsmTag } from "../../src/Logic/Tags/Tag"
|
||||
import { Changes } from "../../src/Logic/Osm/Changes"
|
||||
import ScriptUtils from "../ScriptUtils"
|
||||
|
||||
/**
|
||||
* Note:
|
||||
|
@ -264,10 +265,8 @@ class Openbenches extends Script {
|
|||
let createTest = false
|
||||
|
||||
const osmData = await this.getAlreadyImported()
|
||||
const openBenches = JSON.parse(readFileSync("openbenches_export_josm_.geojson", "utf-8"))
|
||||
await this.conflate(osmData, openBenches)
|
||||
|
||||
// rmSync(dbFile)
|
||||
/*
|
||||
if(!existsSync(dbFile)){
|
||||
console.log("No database file found at "+dbFile+", recreating the database")
|
||||
await this.buildDatabase("/home/pietervdvn/git/openbenches.org/database", dbFile)
|
||||
|
@ -312,13 +311,17 @@ class Openbenches extends Script {
|
|||
}, null, " "), "utf-8")
|
||||
|
||||
const maproulette = features.map(f => {
|
||||
f.properties = {tags: JSON.stringify(f.properties)}
|
||||
const properties = {tags: JSON.stringify(f.properties)}
|
||||
properties["id"] = "openbenches/"+f.properties["openbenches:id"]
|
||||
return {...f, properties}
|
||||
})
|
||||
writeFileSync(`openbenches_export_maproulette_${createTest ? "_test" : ""}.geojson`, JSON.stringify({
|
||||
writeFileSync(`openbenches_export_maproulette${createTest ? "_test" : ""}.geojson`, JSON.stringify({
|
||||
type: "FeatureCollection", features: maproulette,
|
||||
}, null, " "), "utf-8")
|
||||
|
||||
*/
|
||||
|
||||
const openBenches = JSON.parse(readFileSync("openbenches_export_josm_.geojson", "utf-8"))
|
||||
// await this.conflate(osmData, openBenches)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue