Skip to content

Commit

Permalink
Merge pull request #158 from empowerplan/feature/docs-for-external-di…
Browse files Browse the repository at this point in the history
…stilling-error

Add hotfix documentation for externally distilled MVTs error
  • Loading branch information
nesnoj authored May 23, 2024
2 parents 3f2105b + 0ce5960 commit 65054cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sequence_name> RESTART WITH <next-starting-id>

make load_data
```
# Adding new (static) layers
> **Outdated!** - `django-mapengine` is used to set up map sources and layers instead!
Expand Down
2 changes: 1 addition & 1 deletion digiplan/static/js/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ document.querySelectorAll('.layer__switch').forEach(checkbox => {
checkbox.addEventListener('change', event => {
event.target.setAttribute('aria-checked', event.target.checked.toString());
});
});
});

0 comments on commit 65054cb

Please sign in to comment.