2

I am trying to clip a raster layer by a shape define by a polygon.
(A previous question was about a line layer clipping, whereas this one relates to raster layer)

The resulting layer is however an empty layer. To be more specific the resulting layer is raster of 1846x1202 pixels, but it seems to be filled with no-data value.

I am clipping the raster via menu Raster -> Extract -> Clip

Here are some views of the work:

  1. Polygon Shape (Mask):

    vector shape polygon

  2. Raster Layer to clip

    raster layer to clip

  3. Resulting layer (after clipping): Nothing !

    clipped layer: EMPTY

  4. Layers' icons in QGIS Layer Windows

    Layers' appearances

If I do a clipping using a Extent (rectangular selection) instead of Mask Layer (clipping with shape), it works: so I suspect I have a problem with my polygon layer.

Test with 'Extent' clipping

kFly
  • 859
  • 1
  • 11
  • 27

1 Answers1

3

You can't clip a raster file working with ESPG 3857 (WGS 84 / Pseudo-Mercator).


Here is how you can to it:

  1. Richg click on your rasterfile Save as... chose a UTM CRS (look up the right zone before) eg. EPSG 32632) and save the raster file

  2. do the same for you shapefile you want to use for clipping.

  3. Use the raster clipper with your new files Raster -> Extract -> Clip

clipper

example

wittich
  • 2,356
  • 1
  • 16
  • 30
  • I'm still looking for the explanation why ESPG 3857 is not working... If I remember it right it has something to do with spheres and ellipsoids – wittich Mar 02 '16 at 14:43
  • I've followed your advice and converted the raster and the polygon layers successively to CRS ESPG 23031 (UTM31), and ESPG 4326 (WGS84). For both CRS the clipping worked (to the price of multiplying by 5 the size of the raster) – kFly Mar 03 '16 at 21:56
  • However I would like to understand what is wrong with ESPG 3857. What kind of CRS family is it possible to use for clipping and which one are not suitable ? – kFly Mar 03 '16 at 22:00