We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3ee403 commit 7efd81fCopy full SHA for 7efd81f
arho_feature_template/core/plan_manager.py
@@ -454,8 +454,15 @@ def create_geotiff(self):
454
iface.messageBar().pushWarning("", "Tulostusasettelussa ei ole karttaobjektia.")
455
return
456
457
- # Set the map item's extent to the feature's bounding box
458
- map_item.zoomToExtent(feature.geometry().boundingBox())
+ # Expand the bounding box by 10%
+ bbox = feature.geometry().boundingBox()
459
+ buffer_percentage = 0.1
460
+ buffer_x = bbox.width() * buffer_percentage
461
+ buffer_y = bbox.height() * buffer_percentage
462
+ buffered_bbox = bbox.buffered(max(buffer_x, buffer_y))
463
+
464
+ map_item.zoomToExtent(buffered_bbox)
465
+ layout.refresh()
466
467
# Refresh the layout
468
layout.refresh()
qgisprojekti.qgz
938 Bytes
0 commit comments