I am using QGIS 2.18.11 with the Semi - Automatic Classification Plugin (SCP). I use Sentinel 2a as well as Landsat 8 Scenes and run some Classifications with SCP.

Inside my Sentinel 2a scene I have several areas I want to analyse. Therefore I want to clip the (classification)raster by a vector (I created upfront). This works perfect with "clip multiple rasters" by using the vector ... BUT: I need just the pixels inside the vector boundaries which do not have contact with this vector boundary.

I tried an option but it does not succeed:

I transformed the clipped classification raster to vector and clipped the two vector data (boundary and the tranformed classifiaction raster). That worked.

Then I tried to transform this new vector to a raster and hoped that there will be no pixels lying on the boundary but I just get my old classification raster back.

Any comments or suggestions?

Pixel goes beyond the boundary Pixel goes beyond the boundary

This looks like as it should be

this looks like as it should be

  • I think that problem is with pixel size – nagib Sep 9 '17 at 18:48
  • Pixel size does not play a role here. The function is just made to select a pixel if more than half of its area is inside the clipping polygon. That makes most users happy and most of those who are not happy with it want to include all touched pixels. Shrink your cutting polygon by applying a buffer of -(pixel size) and you should be satisfied. – user30184 Sep 9 '17 at 21:21
  • Thanks for the comments. I tried the buffer before but I can not manage it to apply a negative (pixel size) value. Any further help would be nice. I now create a vector according to the inside pixels and clip it with the classification raster. – user12459 Sep 9 '17 at 23:21
  • How did you try to create the negative buffer? – user30184 Sep 10 '17 at 12:09

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.