From cc1b190f9e7b91916b1e74673c18bb56251d7e32 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 5 Mar 2024 02:24:25 +0100 Subject: [PATCH 1/5] Add some documentation --- Docs/SettingUpPSQL.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Docs/SettingUpPSQL.md b/Docs/SettingUpPSQL.md index 6a7f79c9ad..7b19dccad9 100644 --- a/Docs/SettingUpPSQL.md +++ b/Docs/SettingUpPSQL.md @@ -26,8 +26,12 @@ Use `vite-node ./scripts/osm2pgsql/generateBuildDbScript.ts` ## Importing data Install osm2pgsql (hint: compile from source is painless) -To seed the database: +Download the latest with: +`nohup transmission-cli https://planet.osm.org/pbf/planet-latest.osm.pbf.torrent &>nohup_transmission.log &` +which will download the data to `~/Downloads` + +To seed the database: ```` osm2pgsql -O flex -S build_db.lua -s --flat-nodes=import-help-file -d postgresql://user:password@localhost:5444/osm-poi .osm.pbf ```` @@ -49,6 +53,7 @@ HP ProLiant DL360 G7 (1U): 2Rx4 DDR3-memory (PC3) ## Updating data + `osm2pgsql-replication update -d postgresql://user:password@localhost:5444/osm-poi -- -O flex -S build_db.lua -s --flat-nodes=import-help-file` From 77f07f55ecf9140c1c556fb4147c7d5cb74b0645 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 5 Mar 2024 23:20:02 +0100 Subject: [PATCH 2/5] Fix: allow to move (non-snapped) points again after fixing #1809 --- src/UI/Popup/MoveWizardState.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UI/Popup/MoveWizardState.ts b/src/UI/Popup/MoveWizardState.ts index bad0dd8a6e..cdb9255e8e 100644 --- a/src/UI/Popup/MoveWizardState.ts +++ b/src/UI/Popup/MoveWizardState.ts @@ -134,9 +134,10 @@ export class MoveWizardState { // This is a new point. Check if it was snapped to an existing way due to the '_referencing_ways'-tag const store = this._state.featureProperties.getStore(id) store?.addCallbackAndRunD((tags) => { - if (tags._referencing_ways !== "[]") { + if (tags._referencing_ways !== undefined && tags._referencing_ways !== "[]") { console.log("Got referencing ways according to the tags") this.moveDisallowedReason.setData(t.partOfAWay) + return true } }) } From 7aaf7e289648e972cba72f27ef3d6f7d3e33baec Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 7 Mar 2024 00:22:36 +0100 Subject: [PATCH 3/5] Fix attribution display for imgur images with .jpeg extension --- src/Logic/ImageProviders/Imgur.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Logic/ImageProviders/Imgur.ts b/src/Logic/ImageProviders/Imgur.ts index 0ddeb14a86..9c0146de9e 100644 --- a/src/Logic/ImageProviders/Imgur.ts +++ b/src/Logic/ImageProviders/Imgur.ts @@ -85,9 +85,15 @@ export class Imgur extends ImageProvider implements ImageUploader { * expected.date = new Date(1655052078000) * expected.views = 2 * licenseInfo // => expected + * const licenseInfoJpeg = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.jpeg") + * licenseInfoJpeg // => expected + * const licenseInfoUpperCase = await Imgur.singleton.DownloadAttribution("https://i.imgur.com/E0RuAK3.JPEG") + * licenseInfoUpperCase // => expected + * + * */ public async DownloadAttribution(url: string): Promise { - const hash = url.substr("https://i.imgur.com/".length).split(".jpg")[0] + const hash = url.substr("https://i.imgur.com/".length).split(/\.jpe?g/i)[0] const apiUrl = "https://api.imgur.com/3/image/" + hash const response = await Utils.downloadJsonCached(apiUrl, 365 * 24 * 60 * 60, { From 34635b00951765e75f998e4b89fed266e1999bdc Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 7 Mar 2024 00:23:02 +0100 Subject: [PATCH 4/5] Disable ability to move ghost signs, they are snapped in most cases --- assets/themes/ghostsigns/ghostsigns.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/themes/ghostsigns/ghostsigns.json b/assets/themes/ghostsigns/ghostsigns.json index fb17508ad6..ce5c74aec9 100644 --- a/assets/themes/ghostsigns/ghostsigns.json +++ b/assets/themes/ghostsigns/ghostsigns.json @@ -38,9 +38,8 @@ } }, "minzoom": 10, - "allowMove": { - "enableImproveAccuracy": true - }, + "#allowMove": "Normally, a ghost sign is snapped to a wall, so moving won't be possible in most cases", + "allowMove": false, "tagRenderings": [ { "id": "historic", From 39afc645725cee3f97858e1adbac1a13cd507ae4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 7 Mar 2024 17:36:50 +0100 Subject: [PATCH 5/5] Attempt to fix build --- scripts/generateLayouts.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 54cf8e66e0..58b716f42f 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -12,7 +12,6 @@ import SpecialVisualizations from "../src/UI/SpecialVisualizations" import Constants from "../src/Models/Constants" import { AvailableRasterLayers, RasterLayerPolygon } from "../src/Models/RasterLayers" import { ImmutableStore } from "../src/Logic/UIEventSource" -import * as crypto from "crypto" import * as eli from "../src/assets/editor-layer-index.json" import * as eli_global from "../src/assets/global-raster-layers.json" import ValidationUtils from "../src/Models/ThemeConfig/Conversion/ValidationUtils" @@ -374,15 +373,6 @@ async function generateCsp( ].join("\n") } -const removeOtherLanguages = readFileSync("./src/UI/RemoveOtherLanguages.js", "utf8") - .split("\n") - .map((s) => s.trim()) - .join("\n") -const removeOtherLanguagesHash = crypto - .createHash("sha256") - .update(removeOtherLanguages) - .digest("base64") - async function createLandingPage( layout: LayoutConfig, layoutJson: LayoutConfigJson, @@ -461,9 +451,6 @@ async function createLandingPage( const loadingText = Translations.t.general.loadingTheme.Subs({ theme: layout.title }) const templateLines = template.split("\n") - const removeOtherLanguagesReference = templateLines.find( - (line) => line.indexOf("./src/UI/RemoveOtherLanguages.js") >= 0 - ) let output = template .replace("Loading MapComplete, hang on...", asLangSpan(loadingText, "h1")) .replace( @@ -474,10 +461,9 @@ async function createLandingPage( .replace( //, await generateCsp(layout, layoutJson, { - scriptSrcs: [`'sha256-${removeOtherLanguagesHash}'`], + scriptSrcs: [], }) ) - .replace(removeOtherLanguagesReference, "") .replace( /.*/s, asLangSpan(layout.shortDescription)