Refactoring: move download functionality for OsmObjects into a new object

This commit is contained in:
Pieter Vander Vennet 2023-04-20 03:58:31 +02:00
parent 8eb2c68f79
commit 1f9aacfb29
23 changed files with 633 additions and 901 deletions

View file

@ -1,6 +1,7 @@
import ScriptUtils from "./ScriptUtils"
import { appendFileSync, readFileSync, writeFileSync } from "fs"
import { OsmObject } from "../Logic/Osm/OsmObject"
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
ScriptUtils.fixUtils()
@ -17,7 +18,7 @@ const ids = JSON.parse(readFileSync("export.geojson", "utf-8")).features.map(
)
console.log(ids)
ids.map((id) =>
OsmObject.DownloadReferencingRelations(id).then((relations) => {
new OsmObjectDownloader().DownloadReferencingRelations(id).then((relations) => {
console.log(relations)
const changeparts = relations
.filter(