3

I'm working on QGIS 2.2, and I would like to make a vector layer extent bigger (thus the clip option is not suitable) to match exactly my mask layer extent. I would like the new added area to be empty. I can't seem to find a way to edit the extent.

1
  • (I put here a comment from Chris W) Can you further expand/clarify what you are trying to accomplish by this action? I suspect there may be other implications or considerations.
    – radouxju
    Commented Jun 4, 2014 at 7:02

1 Answer 1

6

The extent of a layer should be the minimum bounding box (mbb) of all features in the layer, and would not extend beyond that. It could also mean the maximum possible extents based on the unit resolution.

What follows is true in ArcGIS, and I do not know if it will operate the same way in QGIS. The extent automatically expands to be the mbb for all features. However it does not automatically shrink if outer features are removed. So you could draw a box the extent of or insert your mask layer and then delete it. Theoretically when cleanup is run on the database or anything is exported the extent will be reset to the mbb. The extent can also be manually typed in, or recalculated and even imported from another feature class through buttons on the Feature Extents tab of the feature class properties through ArcCatalog.

In QGIS, on the General tab of the Layer Properties, there is an Update Extents button, as shown in the screenshot. I am making an assumption that is there for the same reason the recalculate button is in ArcGIS - that extent automatically grows but doesn't shrink. Worth a try anyway.

Layer Properties | General

4
  • My experience is that wrong layer extent is in my case usually caused by issue with geometry. To check use Vector / Geometry tools / Check geometry validity...
    – Miro
    Commented May 11, 2017 at 0:31
  • I'm using QGIS 2.18.17 and do not get the "Update extents" button on that screen.
    – CPBL
    Commented Aug 2, 2018 at 17:53
  • 1
    @CPBL This answer was posted prior to that version. I don't know when it changed, but the version I currently have installed (3.2.0) there is no General tab anymore, it's now under the Source tab (entire Coordinate System section is there). If you still don't see it, that may be due to the type of data the layer contains (ie non-shape).
    – Chris W
    Commented Aug 21, 2018 at 14:33
  • 3
    In version 3.14, "Update Extents" is to be found in Layer Properties>Settings. Sometimes it does not work. A bug was reported for it in 2019, but it seems not to have been addressed. One workaround is to save as a new layer.
    – IanS
    Commented Aug 3, 2020 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.