gem / oq-irmt-qgis

QGIS plugin to drive the OpenQuake Engine, to develop Social Vulnerability and Integrated Risk composite indices, and to predict building recovery times following an earthquake
https://plugins.qgis.org/plugins/svir/
8 stars 3 forks source link

Increase the extent of layers having an empty extent in order to allow zooming to layer #838

Closed ptormene closed 1 year ago

ptormene commented 1 year ago

Fixes https://github.com/gem/oq-irmt-qgis/issues/206

I am doing it when creating layers of any kind, because the extent is always a rectangle and, even if in the properties it is displayed as empty, the object actually contains the coordinates. Therefore we can just increase the rectangle by a small delta. With this fix, the plugin automatically (and correctly) zooms to layer also when loading a layer with only one point.

What we obtain is something more usable than before, although we introduce a little inconsistency, because we are declaring that the extent of our layer is bigger than its actual extent (that in fact is just a point). I believe the benefits justify the little inconsistency.

ptormene commented 1 year ago

I've ported this change also to v3.16.2 (stable) and to master and I've released v3.16.2 (stable) and v.3.17.8 (experimental).