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 Answer
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.
-
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...– MiroCommented May 11, 2017 at 0:31
-
I'm using QGIS 2.18.17 and do not get the "Update extents" button on that screen.– CPBLCommented 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 WCommented Aug 21, 2018 at 14:33
-
3In 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.– IanSCommented Aug 3, 2020 at 10:34