Skip to content

Commit

Permalink
Fix regression with basemap creation, which also uses area of interest
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Mar 8, 2024
1 parent 7936c96 commit 12df495
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions libqfieldsync/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ def __init__(
self.attachment_dirs = attachment_dirs
self.dirs_to_copy = dirs_to_copy

assert (
self.area_of_interest_crs.isValid()
), f"Invalid CRS specified for area of interest {area_of_interest_crs}"

self.offliner = offliner

self.offliner.layerProgressUpdated.connect(self._on_offline_editing_next_layer)
Expand All @@ -124,6 +120,15 @@ def __init__(

self.project_configuration = ProjectConfiguration(project)

if (
self.project_configuration.offline_copy_only_aoi
or self.project_configuration.create_base_map
):
assert self.area_of_interest.isValid()[0]
assert (
self.area_of_interest_crs.isValid()
), f"Invalid CRS specified for area of interest {area_of_interest_crs}"

# flake8: noqa: max-complexity: 33
def convert(self, reload_original_project: bool = True) -> None:
"""
Expand Down Expand Up @@ -295,7 +300,7 @@ def _convert(self, project: QgsProject) -> None:
gpkg_filename = str(self.export_folder.joinpath("data.gpkg"))
if offline_layers:
bbox = None
if self.area_of_interest.isValid():
if self.project_configuration.offline_copy_only_aoi:
bbox = QgsCoordinateTransform(
QgsCoordinateReferenceSystem(self.area_of_interest_crs),
QgsProject.instance().crs(),
Expand Down

0 comments on commit 12df495

Please sign in to comment.