Fix: use api.openstreetmap.org on many places, fix #1573

This commit is contained in:
Pieter Vander Vennet 2023-09-21 00:25:04 +02:00
parent 1930f7bb53
commit 8fccf78478
14 changed files with 36 additions and 35 deletions

View file

@ -21,7 +21,7 @@ const latestTags = {
"public_bookcase:type": "reading_box",
}
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/node/5568693115", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/node/5568693115", {
version: "0.6",
generator: "CGImap 0.8.5 (1815943 spike-06.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",

View file

@ -11,7 +11,7 @@ import { ImmutableStore } from "../../../../src/Logic/UIEventSource"
import { OsmConnection } from "../../../../src/Logic/Osm/OsmConnection"
describe("RelationSplitHandler", () => {
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/node/1124134958/ways", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/node/1124134958/ways", {
version: "0.6",
generator: "CGImap 0.8.5 (2937646 spike-07.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",
@ -81,7 +81,7 @@ describe("RelationSplitHandler", () => {
})
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/relation/9572808/full",
"https://api.openstreetmap.org/api/0.6/relation/9572808/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (3128319 spike-07.openstreetmap.org)",
@ -200,7 +200,7 @@ describe("RelationSplitHandler", () => {
}
)
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/way/687866206/full", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/way/687866206/full", {
version: "0.6",
generator: "CGImap 0.8.5 (2601512 spike-07.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",
@ -250,7 +250,7 @@ describe("RelationSplitHandler", () => {
],
})
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/way/690497698/full", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/way/690497698/full", {
version: "0.6",
generator: "CGImap 0.8.5 (3023311 spike-07.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",
@ -311,7 +311,7 @@ describe("RelationSplitHandler", () => {
],
})
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/relation/4374576/full",
"https://api.openstreetmap.org/api/0.6/relation/4374576/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (1266692 spike-06.openstreetmap.org)",
@ -342,7 +342,7 @@ describe("RelationSplitHandler", () => {
}
)
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/way/143298912/full", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/way/143298912/full", {
version: "0.6",
generator: "CGImap 0.8.5 (4046166 spike-07.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",

View file

@ -327,7 +327,7 @@ describe("ReplaceGeometryAction", () => {
const wayId = "way/160909312"
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/map.json?bbox=3.2166673243045807,51.21467321525788,3.217007964849472,51.21482442824023",
"https://api.openstreetmap.org/api/0.6/map.json?bbox=3.2166673243045807,51.21467321525788,3.217007964849472,51.21482442824023",
{
version: "0.6",
generator: "CGImap 0.8.6 (1549677 spike-06.openstreetmap.org)",
@ -715,7 +715,7 @@ describe("ReplaceGeometryAction", () => {
}
)
Utils.injectJsonDownloadForTests("https://www.openstreetmap.org/api/0.6/way/160909312/full", {
Utils.injectJsonDownloadForTests("https://api.openstreetmap.org/api/0.6/way/160909312/full", {
version: "0.6",
generator: "CGImap 0.8.6 (2407324 spike-06.openstreetmap.org)",
copyright: "OpenStreetMap and contributors",
@ -880,7 +880,7 @@ describe("ReplaceGeometryAction", () => {
[3.2166673243045807, 51.21467321525788],
[3.217007964849472, 51.21482442824023],
])
const url = `https://www.openstreetmap.org/api/0.6/map.json?bbox=${bbox.minLon},${bbox.minLat},${bbox.maxLon},${bbox.maxLat}`
const url = `https://api.openstreetmap.org/api/0.6/map.json?bbox=${bbox.minLon},${bbox.minLat},${bbox.maxLon},${bbox.maxLat}`
const data = await Utils.downloadJson(url)
const fullNodeDatabase = new FullNodeDatabaseSource()
fullNodeDatabase.handleOsmJson(data, 0, 0, 0)

View file

@ -9,7 +9,7 @@ describe("SplitAction", () => {
{
// Setup of download
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/941079939/full",
"https://api.openstreetmap.org/api/0.6/way/941079939/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (957273 spike-08.openstreetmap.org)",
@ -210,7 +210,7 @@ describe("SplitAction", () => {
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/941079939/relations",
"https://api.openstreetmap.org/api/0.6/way/941079939/relations",
{
version: "0.6",
generator: "CGImap 0.8.5 (2419440 spike-07.openstreetmap.org)",
@ -222,7 +222,7 @@ describe("SplitAction", () => {
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/295132739/full",
"https://api.openstreetmap.org/api/0.6/way/295132739/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (3138407 spike-07.openstreetmap.org)",
@ -409,7 +409,7 @@ describe("SplitAction", () => {
}
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/295132739/relations",
"https://api.openstreetmap.org/api/0.6/way/295132739/relations",
// Mimick that there are no relations relation is missing
{
version: "0.6",
@ -422,7 +422,7 @@ describe("SplitAction", () => {
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/61435323/full",
"https://api.openstreetmap.org/api/0.6/way/61435323/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (53092 spike-08.openstreetmap.org)",
@ -488,7 +488,7 @@ describe("SplitAction", () => {
}
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/61435323/relations",
"https://api.openstreetmap.org/api/0.6/way/61435323/relations",
{
version: "0.6",
generator: "CGImap 0.8.5 (3622541 spike-06.openstreetmap.org)",
@ -2567,7 +2567,7 @@ describe("SplitAction", () => {
}
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/61435332/full",
"https://api.openstreetmap.org/api/0.6/way/61435332/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (3819319 spike-06.openstreetmap.org)",
@ -2620,7 +2620,7 @@ describe("SplitAction", () => {
}
)
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/way/509668834/full",
"https://api.openstreetmap.org/api/0.6/way/509668834/full",
{
version: "0.6",
generator: "CGImap 0.8.5 (3735280 spike-06.openstreetmap.org)",

View file

@ -8,7 +8,7 @@ import OsmObjectDownloader from "../../../src/Logic/Osm/OsmObjectDownloader"
describe("OsmObject", () => {
describe("download referencing ways", () => {
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/node/1124134958/ways",
"https://api.openstreetmap.org/api/0.6/node/1124134958/ways",
{
version: "0.6",
generator: "CGImap 0.8.6 (49805 spike-06.openstreetmap.org)",
@ -89,7 +89,7 @@ describe("OsmObject", () => {
it("should download full OSM-relations", async () => {
ScriptUtils.fixUtils()
Utils.injectJsonDownloadForTests(
"https://www.openstreetmap.org/api/0.6/relation/5759328/full",
"https://api.openstreetmap.org/api/0.6/relation/5759328/full",
JSON.parse(readFileSync("./test/data/relation_5759328.json", { encoding: "utf-8" }))
)
const r = await new OsmObjectDownloader()