From 8326132413b6f7882c7fd8c71d61a68e5dbf361b Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Tue, 5 Mar 2024 09:38:21 +0700 Subject: [PATCH] Handle empty area of interest WKT string to fix project cable packaging --- libqfieldsync/offline_converter.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libqfieldsync/offline_converter.py b/libqfieldsync/offline_converter.py index ecaad26..9d3681b 100644 --- a/libqfieldsync/offline_converter.py +++ b/libqfieldsync/offline_converter.py @@ -112,7 +112,6 @@ def __init__( self.attachment_dirs = attachment_dirs self.dirs_to_copy = dirs_to_copy - 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}" @@ -295,11 +294,13 @@ def _convert(self, project: QgsProject) -> None: gpkg_filename = str(self.export_folder.joinpath("data.gpkg")) if offline_layers: - bbox = QgsCoordinateTransform( - QgsCoordinateReferenceSystem(self.area_of_interest_crs), - QgsProject.instance().crs(), - QgsProject.instance(), - ).transformBoundingBox(self.area_of_interest.boundingBox()) + bbox = None + if self.area_of_interest.isValid(): + bbox = QgsCoordinateTransform( + QgsCoordinateReferenceSystem(self.area_of_interest_crs), + QgsProject.instance().crs(), + QgsProject.instance(), + ).transformBoundingBox(self.area_of_interest.boundingBox()) is_success = self.offliner.convert_to_offline( gpkg_filename,