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

6
  • 2
    Probably an issue with the CRS... Check this answer...
    – wittich
    Commented Mar 1, 2016 at 23:20
  • 2
    Possible duplicate of How to clip a line layer based on polygons with QGIS?
    – wittich
    Commented Mar 1, 2016 at 23:20
  • Thanks you for your answer, it is definitely not a SRS issue: I have been consistent for all layers (SRS ESPG 3857), and I have triple-checked each SRS/CRS.
    – kFly
    Commented Mar 2, 2016 at 0:42
  • I am using QGIS 2.8.1
    – kFly
    Commented Mar 2, 2016 at 0:50
  • 1
    This seems to be about clipping a raster with a vector polygon, whereas the proposed duplicate is about clipping vector lines with vector polygons. Consequently, I don't think it is a duplicate.
    – PolyGeo
    Commented Mar 2, 2016 at 11:14

1 Answer 1

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

3
  • 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
    Commented Mar 2, 2016 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
    Commented Mar 3, 2016 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
    Commented Mar 3, 2016 at 22:00

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.