2

I've been looking for a manner to change a vector extent in QGIS, but it's unsuccessfull!

I want change extent because in the past, I had problems to convert vector to raster. I try present the problem bellow:

I'm InVEST user. InVEST is a set of models developed by Natural Capital Project to mapping, quantifying and valuing Ecosystem Services. A while ago, I had a problem with the Carbon model. Actual LULC and Future LULC are input datas beside others. When I analysed this datas I perceived different extents. The model uses the extent when converting vector to raster during processing, therefore the Actual LULC pixels and Future LULC pixels did not fit properly. Another model's process is map algebra. When model executing map algebra, the results present a pattern due to LULC datas misalignment. I corrected this problem using the same extent for two LULC data.In ArcGIS the way to acomplish this task is very simple.

I was ArcGIS user. I've been using QGIS recently. ArcGIS and QGIS work with extent in different ways? Are there a manner to change vector extent in QGIS?

  • The extent of a vector layer is the extent of its features. That's the definition of the extent. Why do you want an "extent" that is actually wider than the features in the layer? – Spacedman May 22 '18 at 21:31
  • Do you mean extents of the map view/viewport? If so, you can click on "New Bookmark" and set the extents there. – cm1 May 22 '18 at 21:35
  • Hi Spacedman and cm1! I'm refer to extent of vector. I'm using a model and in their process the model building rasters and proceding mapping algebra. Sometime, when there are diferent extent of features de pixels don't fit suitable, and then, wrong results happen. – THIAGO CARLOS LOPES RIBEIRO May 22 '18 at 23:00
  • 1
    In QGIS the extent of a layer is the aggregated extent of individual features. You can't make it any bigger as you have noticed. If the process gives wrong results because of this there may be a bug in the process or the model should be improved. Describe your model and what actually goes wrong. – user30184 May 23 '18 at 6:23
  • 2
    I thing you should edit your question to show what you mean by this. It sounds like what you want to set is the extent of some analysis, which is perhaps the max extent of the data in the analysis - either way, its not the extent of the vector data, which is fixed. – Spacedman May 23 '18 at 6:41
0

The extent of vectors cannot be changed as it is the extent of its features. As I understand Your problem has arisen due to misalignment which was caused due to the different extents of vectors, due to which the rasters also have different extent. The solutions is to align the rasters among themselves by resampling. In the Raster Menu Bar, there is Align Rasters... tools which will resample the rasters to a common extent.

  • Thanks for your answer neogeomat! I haven't known Align Raster yet. My problem with extent is about vector. The process to convert vector to raster is run by model. The model work standalone. Then I need use input datas with the same extent. Do you know a manner to do this? – THIAGO CARLOS LOPES RIBEIRO May 25 '18 at 2:08
0

It sounds like your vector layers do not share a common extent. Decide on an extent (it can be no larger than your smallest vector layer and must either match or be within the of the extents of each layer you wish to use) then clip all your input vector layers to this common extent.

You can use Extract Layer Extent under Layer tools in the Processing toolbox and use the result to clip your input layers.

Or alternatively can use the extent of the visible map canvas by typing the following in the Python console.

print(iface.mapCanvas().extent())

Or toggling this button in the status bar at the bottom of the screen

Coordinates/extent toggle

Coordinates/extent toggle

You can then use Extract/Clip by Extent, under Vector Overlay in the Processing toolbox, to clip your input vector data to a uniform extent.

Your Answer

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

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