-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zoom to layer extent does not work for a point layer with a single point. #14307
Comments
Author Name: Steven Mizuno (Steven Mizuno) Also occurs on two (or more) points having the same x- or y-coordinate, or a line that is exactly vertical or horizontal. The reason is that Legend zoom to function bails on an empty extent, where it really ought to check the width/height individually and set an appropriate extent. And it should set some reasonable extent for a single point. It has occurred to me that the map canvas should have a setExtent sort of function that handles zero-width or -height and adds in the 5% buffer for the various zoom to ... actions as this is a common behavior. This would make for uniform handling of such zoom requests and eliminate duplicate coding of the extent calculations especially for these special cases. |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Paolo Cavallini (@pcav)
|
Author Name: Paolo Cavallini (@pcav)
|
Author Name: Alister Hood (@AlisterH)
Not anymore. But if you select the point then zoom to selection works. |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Antonio Locandro (Antonio Locandro) Can't you do something like add a percentage around the point so the zoom actually works, it shouldn't be a difficult fix for developers to do yet it seems to be left out for some future release which I suspect will never come considering this issue was first reported 2011. This frustrates a lots of users which expect it to work. |
Author Name: Sandro Santilli (@strk) A percentage won't work as a point has dimension 0, which multiplied by any factor is still 0. |
Author Name: Sandro Santilli (@strk) Sorry, the "apply a scale" wont work to zoom to a single layer if others also exist. Ideally for a single-point layer "zoom to layer" would just set center, not changing existing scale. The "apply an arbitrary scale" work for when no scale was set yet (ie: single point layer is the first layer being loaded). |
Author Name: Médéric RIBREUX (Médéric RIBREUX) Hello, bug triage... it seems to be fixed: in QGIS 2.13 master, I can "zoom" on a layer with only a point. If the point layer is the only layer loaded in QGIS, the map canvas is then centered to the point but the scale is not changed. When there is another layer (tested with another polygon layer), zooming on the point layer change the scale and put the point in the view. It is not centered on the point but the point is displayed. I think this is a good compromise. Having to zoom on only one layer loaded with only one point is far from being a common use case, so we don't really care about the scale that we can change by ourself as far as the point is visible. And when there is another layer, the point is not centered (it is up) but it is visible at a decent scale.
|
Author Name: Alister Hood (@AlisterH)
I don't think this aspect is a good compromise - at least it will actually show the point now, but centering would be better. |
Author Name: Giovanni Manghi (@gioman) Médéric RIBREUX wrote:
I cannot confirm on the latest master, it is also centered... so to me this bug is fixed. Please test and report back. |
Author Name: Alister Hood (@AlisterH) Me too.
|
Author Name: Alister Hood (@AlisterH)
Original Redmine Issue: 4375
Affected QGIS version: master
Redmine category:vectors
Just what the title says.
It does not matter whether or not on-the-fly projection is enabled.
But note that "Zoom full" does work if this is the only layer.
The text was updated successfully, but these errors were encountered: