-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Export basemap as mbtiles during cable export #105
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts and reflections about the ongoing dev work made so far.
ping @suricactus
@@ -556,6 +558,26 @@ def _export_basemap(self) -> bool: | |||
) | |||
return False | |||
|
|||
exported_tiff = self._export_basemap_as_tiff(extent, base_map_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this tiff
basemap generation function still be called there ?
feedback = QgsProcessingFeedback() | ||
context = QgsProcessingContext() | ||
context.setProject(project) | ||
context.setFlags(context.flags() | QgsProcessingAlgorithm.FlagNoThreading) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have been adding this line to stabilize the behaviour of the export, since I faced some QGIS crashes when developing this.
Con side: makes the external processing alg run on the main thread, thus freezing QGIS during this mbtiles export, which might possibly be long in case the user has some data on a large area, and configured min/max tiles zoom level with a big interval.
This needs to be discussed IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure we should not be running this on the main thread. Let's discuss ways to run this in the background.
@property | ||
def base_map_tiles_min_zoom_level(self) -> int: | ||
base_map_tiles_min_zoom_level, _ = self.project.readNumEntry( | ||
"qfieldsync", ProjectProperties.BASE_MAP_TILES_MIN_ZOOM_LEVEL, 14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am wondering about mbtiles min / max zoom default values. My proposition is 14 / 16, open to discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would better go for 14/14.
This PR makes the cable export generate a
mbtiles
basemap for QField, thus enabling multiple raster zoom levels.Subtasks:
native:tilesxyzmbtiles
processing algorithm to generate a mbtiles fileSingle layer
basemap mbtiles export during cable exportSingle layer
basemap mbtiles export during cable exportSingle layer
basemap mbtiles in QField appMap theme
basemap mbtiles export during cable exportMap theme
basemap mbtiles export during cable export as well as QField usageMap theme
basemap mbtiles in QField app