Skip to content
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

Closed
qgib opened this issue Oct 13, 2011 · 13 comments
Closed

Zoom to layer extent does not work for a point layer with a single point. #14307

qgib opened this issue Oct 13, 2011 · 13 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Oct 13, 2011

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.

@qgib
Copy link
Contributor Author

qgib commented Oct 14, 2011

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.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was configured as Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0
  • version was configured as master
  • crashes_corrupts_data was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Sep 18, 2013

Author Name: Alister Hood (@AlisterH)


But note that "Zoom full" does work if this is the only layer.

Not anymore. But if you select the point then zoom to selection works.

@qgib
Copy link
Contributor Author

qgib commented Jun 28, 2014

Author Name: Jürgen Fischer (@jef-n)


  • fixed_version_id was changed from Version 2.0.0 to Future Release - Lower Priority

@qgib
Copy link
Contributor Author

qgib commented Aug 2, 2014

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.

@qgib
Copy link
Contributor Author

qgib commented Mar 23, 2015

Author Name: Sandro Santilli (@strk)


A percentage won't work as a point has dimension 0, which multiplied by any factor is still 0.
What would work is an arbitrary scale to apply. I guess 1:1 would work.

@qgib
Copy link
Contributor Author

qgib commented Mar 23, 2015

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).

@qgib
Copy link
Contributor Author

qgib commented Dec 5, 2015

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.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Dec 5, 2015

Author Name: Alister Hood (@AlisterH)


It is not centered on the point but the point is displayed.

I don't think this aspect is a good compromise - at least it will actually show the point now, but centering would be better.

@qgib
Copy link
Contributor Author

qgib commented Dec 20, 2015

Author Name: Giovanni Manghi (@gioman)


Médéric RIBREUX wrote:

Hello, bug triage...

It is not centered on the point but the point is displayed.

I cannot confirm on the latest master, it is also centered... so to me this bug is fixed. Please test and report back.

@qgib
Copy link
Contributor Author

qgib commented Dec 20, 2015

Author Name: Alister Hood (@AlisterH)


Me too.


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed/implemented

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats) labels May 24, 2019
@qgib qgib added this to the Future Release - Lower Priority milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant