2

When I use QGIS 3.4.4 on Windows 10 and right click on a layer then select Zoom to Layer I zoom to half of the earth even though the 3 items on the layer are within 50 meters of each other. I tried to use QGIS Layer Properties - Update Extents Button (See screen shot) and this really did not do much. I then used the Python Console to set layer extents from a rectangle.

layer = iface.activeLayer()
rectang1 = QgsRectangle (-30878130,17423412,-30877366,17422953)
layer.setExtent(rectang1)
'''Michigan South'''

That worked fine. I only do this once in awhile. Is there another button in QGIS that will reset a layers extents to the minimum bounding box?

The processing toolbox has an excellent tool to generate the Bounding geometry but I want to set the layer's extents not just find it. Oriented minimum bounding box tool missing from QGIS processing toolbox?

enter image description here

  • 1
    Have you tried resaving the layer (right-click > Export > Save Features As). There is an option to set the extent of the output. – Joseph Feb 22 '19 at 13:51
  • 1
    Yes. Exporting and resetting the extent does work. Thanks I was just thinking that this is what the Update Extents button was for. – Cary H Feb 25 '19 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.