Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hotfix documentation for externally distilled MVTs error #158

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
});
});
});
Loading