Move project extent reprojection from Django to QGIS worker - #1763
Merged
Conversation
Collaborator
suricactus
approved these changes
Aug 13, 2026
suricactus
left a comment
Collaborator
There was a problem hiding this comment.
8 lines less! Great!
manylon
force-pushed
the
QF-8613-move-reprojection
branch
from
August 14, 2026 07:31
27709c8 to
8fa6f97
Compare
suricactus
reviewed
Aug 14, 2026
suricactus
reviewed
Aug 16, 2026
suricactus
reviewed
Aug 17, 2026
suricactus
approved these changes
Aug 17, 2026
Contributor
Author
|
Thanks, will clean history and merge. |
- Add `reproject_extent()` to `docker-qgis/qfc_worker/utils.py`, using `QgsCoordinateTransform` to reproject a `QgsRectangle` to WGS84 (EPSG:4326) and validating the result against the target CRS's area of use - Compute the reprojected extent in `_extract_project_details`, then store the WKT (or an empty string on failure) in `details["extent"]` - In `QgisProjectQueryset.update_from_details()` in `docker-app/qfieldcloud/project/models.py` just parse the already-reprojected WKT with `GEOSGeometry` - Remove the unused `transform_wkt_crs()` helper and its Django-side tests (`geometry_utils.py`, `test_geometry_utils.py`, `test_utils.py`) - Add tests for `reproject_extent()` - Document in `type_defs.py` that `extent` is now pre-reprojected WGS84 WKT
manylon
force-pushed
the
QF-8613-move-reprojection
branch
from
August 17, 2026 13:19
7a8bed7 to
d86e098
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now, we did the re-projection for
QgisProject.extentfrom the clients CRS to our target one (WGS 84) in the Django on every run ofQgisProjectQueryset.update_from_details(), which is not efficient. Thats why this PR moves it to QGIS worker.Changes:
reproject_extent()todocker-qgis/qfc_worker/utils.py, usingQgsCoordinateTransformto reproject aQgsRectangleto WGS84 (EPSG:4326) and validating the result against the target CRS's area of useopen_qgis_project_temporarily()right after reading the project, storing the WKT (or an empty string on failure) indetails["extent"]QgisProjectQueryset.update_from_details()indocker-app/qfieldcloud/project/models.pyjust parse the already-reprojected WKT withGEOSGeometrytransform_wkt_crs()helper and its Django-side testsreproject_extent()type_defs.pyandprocess_projectfile.pythatextentis now pre-re-projected in WGS84