From aae30e6adcd93a968c128e2405be5686c0b327ee Mon Sep 17 00:00:00 2001 From: Hendrik Huyskens Date: Thu, 23 May 2024 15:25:58 +0200 Subject: [PATCH 1/2] Add hotfix documentation for externally distilled MVTs error --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 995ba95c..63c811c3 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,30 @@ docker cp digiplan_distill:/app/distill/ ./digiplan/static/mvts/ docker rm -f epp_distill ``` +**Attention!** +If you use externally distilled MVTs (distilling done on other server and MVTs copied to current server), +feature IDs stored in MVTs might not fit to IDs in current database. +This leads to wrong popups (if ID points to different existing ID) or errors when creating popups (if ID is not present in DB). +A workaround for this situation is to change IDs of current database in order to match IDs of external server. +Therefore, either all IDs have to me mapped, or (the way I did it last time) related models (the ones having popups) +have to be emptied, PK sequences reset to value matching external starting ID and reloaded. + +Pseudo commands from console: +``` +python manage.py shell + +from digiplan.models import Model +Model.objects.all().delete() +exit() + +python manage.py dbshell + +ALTER SEQUENCE RESTART WITH + +make load_data +``` + + # Adding new (static) layers > **Outdated!** - `django-mapengine` is used to set up map sources and layers instead! From 0ce5960e099a5e5ba3b92526fccc7f264d9e4a12 Mon Sep 17 00:00:00 2001 From: nesnoj Date: Thu, 23 May 2024 16:16:53 +0200 Subject: [PATCH 2/2] Make lint happy --- digiplan/static/js/elements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digiplan/static/js/elements.js b/digiplan/static/js/elements.js index 726cc264..61584e7d 100644 --- a/digiplan/static/js/elements.js +++ b/digiplan/static/js/elements.js @@ -112,4 +112,4 @@ document.querySelectorAll('.layer__switch').forEach(checkbox => { checkbox.addEventListener('change', event => { event.target.setAttribute('aria-checked', event.target.checked.toString()); }); -}); \ No newline at end of file +});