Skip to content

Commit

Permalink
Handle empty area of interest WKT string to fix project cable packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Mar 5, 2024
1 parent 3c0b0c4 commit 8326132
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libqfieldsync/offline_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8326132

Please sign in to comment.