Это видео недоступно.
Сожалеем об этом.

Clip a Raster with a Polygon in QGIS (Extract by Mask)

Поделиться
HTML-код
  • Опубликовано: 5 апр 2021
  • This tutorial demonstrates how to use QGIS to clip a raster layer to the shape of a polygon. This operation is also referred to as clip by mask, or extract by mask. QGIS makes clipping a layer to polygon very simple. If you're having trouble with no data values being displayed as zero or in black, this tutorial will show you how to fix it.
    Website: opensourceoptions.com
    Sign up for email notifications (opensourceoptions.com/subscribe) and get $5 off any course at opensourceoptions.com/course-...

Комментарии • 69

  • @sam_ua
    @sam_ua 6 месяцев назад +1

    thanks a lot! made a dozen steps in order to achieve the result needed, but then discovered this feature with no data value - exceptionally thanks to your example! all the best

  • @pitruchhaya
    @pitruchhaya 3 года назад +2

    Thanks, much needed. I tried this in Q 3.10.4 and it showed the exact output as Extract by Mask in ArcMap. Also, when I exported it to ASCII using the Translate tool, there was no need to set the NoData values and kept it as default, and it worked.

  • @Pipi108
    @Pipi108 Месяц назад

    3 years later and its still helping out people like me! Thank you for taking your time to make this video

  • @guodingchen3350
    @guodingchen3350 3 года назад +13

    interesting shape!

  • @hsahil_10
    @hsahil_10 Месяц назад

    Thank you for the nice explanation. I had difficulty with that black area around my clipped raster.

  • @jacknguyen5063
    @jacknguyen5063 Год назад +1

    Thanks for clearly explanation! it is so helpful to me

  • @krishnendupolley6100
    @krishnendupolley6100 3 года назад +15

    Thanks for the tutorial, but my clipped layer appears with a black rectangle around it, how can I get rid of it? I think you have explained it at the last part of your tutorial, but if you can explain it in a bit detail, it will be helpful for me.

  • @locrogin
    @locrogin 3 года назад +1

    Thanks very much for showing me how to do this!

  • @42Pursuit
    @42Pursuit Год назад

    Exactly what I was looking for. Thanks!

  • @youhasful
    @youhasful Год назад

    really great, works nicely. Thanks!

  • @saeidshamsaliei2536
    @saeidshamsaliei2536 2 года назад +1

    Thank you very much. very helpful

  • @bugsmasherr3133
    @bugsmasherr3133 Год назад +1

    Omg thank you. I didnt know that I need to assign a no data value. I've been so frustrated with that black border.

  • @geovaniferraz5319
    @geovaniferraz5319 2 месяца назад

    Thank you so much, this thing about "specified nodata" save my life, was kinda frustrating the images with the black parts

  • @rathaiahyv3469
    @rathaiahyv3469 2 года назад

    very nice explanation. thanks

  • @anuragverma-by8ww
    @anuragverma-by8ww 15 дней назад

    THANK YOU!!!

  • @bukumun
    @bukumun 10 месяцев назад

    thanks, very helpful

  • @alexgabriel5650
    @alexgabriel5650 2 года назад

    Thank you very much!

  • @alialsakkaf4799
    @alialsakkaf4799 8 месяцев назад

    that is great ! many thanks

  • @mbtnc
    @mbtnc 2 года назад

    Hello, What is the difference between a "normal" view and a materialized view? Why can a materialized view make more sense with raster data?

  • @sittietidong2094
    @sittietidong2094 Год назад +1

    Why you did not include how you put the polygon and what is the purpose

  • @godwin.k
    @godwin.k Год назад

    Indredible ! I'm now find a solution! Thanks ! I have another question. After doing a clip action , I have a very bad resolution for my output. I try everything , but I still have it

    • @geospatialschool
      @geospatialschool  Год назад

      You should be able to adjust the resolution when running the tool.

    • @godwin.k
      @godwin.k Год назад

      @@geospatialschool Thanks for your response but how to do it ?

  • @Chicojls
    @Chicojls 2 года назад

    hey, so my main raster has unique value symbology, and a bunch of named classes and colors i chose by hand. Is it possible to clip the main raster and keep the information like symbology and so on? Because i clipped and it changed the colors and the values to default.

    • @Chicojls
      @Chicojls 2 года назад +1

      Nevermind, figured it out. I notice we can save a color map file and that did the job. Thanks anyway

  • @priyankapriyadarshinisahoo7582
    @priyankapriyadarshinisahoo7582 5 месяцев назад

    How do I save the masked portion so as to use it as a DEM for other new projects??
    PLEASE HELP!!!!!!!

    • @geospatialschool
      @geospatialschool  5 месяцев назад

      Select the option to save to a file then enter the file name to save it.

  • @benhall2680
    @benhall2680 2 года назад +3

    Nice tutorial! What if I want to reverse the clip, that is, only keep that part of the raster that is outside of the polygon?

    • @colbygeary2313
      @colbygeary2313 2 года назад

      You ever find a solution?

    • @kopicaptupai
      @kopicaptupai 2 года назад

      me too im looking for this kind solution

    • @VHenrik007
      @VHenrik007 2 года назад

      Same, is there a way to do that?

    • @RobertThomson
      @RobertThomson 2 года назад

      Bump...I'm keen to know if this is possible too.

    • @VHenrik007
      @VHenrik007 2 года назад

      @@RobertThomson So I found a way in the end, however it's not exactly what I hoped it'd be.
      You have to create another shape layer, which covers the whole original raster. And then you have to subtract the mask from that huge shape layer, making a third one. This was the only option I found.

  • @kerwinkencunanan35
    @kerwinkencunanan35 4 месяца назад

    HELP
    The Following Layers Were Not Correctly Generated always pops up!

  • @karensalisbury2289
    @karensalisbury2289 3 года назад

    On some clips, the colouration alters, I have one with thick red lines on the raster. when I do a clip the result is with very thin, dashed lines. Is there a setting I need?

    • @geospatialschool
      @geospatialschool  3 года назад

      It sounds like after the clip your raster may be overlapping a vector layer? Rasters are not going to be displayed as lines.

    • @karensalisbury2289
      @karensalisbury2289 3 года назад

      @@geospatialschool the original image has clear thick red bourndary in the image but the clip is "washed out" I was hoping to paste an image of both, but cant see an option

  • @user-zq9es8tl3i
    @user-zq9es8tl3i Год назад

    Hello, I am trying to the exact opposite of this. Basically I would want to cut that shape out the raster and keep the rectangular raster and leave the polygone blank. What is the best way to do this?

    • @geospatialschool
      @geospatialschool  Год назад

      You'll do it the exactly the same. You just need to make a polygon for the area you want to keep. To do that you might need to create a larger polygon, then difference it from the area you want to remove.

  • @joshuah.9687
    @joshuah.9687 2 года назад

    Following this, I get the correct clipped raster, but the resolution has drastically dropped. I tried checking "Keep resolution of input raster", but nothing changed. Resolution still dropped.

    • @joshuah.9687
      @joshuah.9687 2 года назад

      Checking the pixel size on both layers, the original states: 9.25,-9.25, but the clipped raster also has the same pixel #, but what is on screen is a lot different...

  • @kikilriki
    @kikilriki 2 года назад +1

    i get "ERROR 1: Cannot compute bounding box of cutline. Cannot find source SRS" and don't knwo what to do, nothing works!

    • @keithbjohnson1
      @keithbjohnson1 2 года назад

      I had the same error message. I entered the "Source CRS" value... even though it displays the CRS for the input layer, I copied that into the Source CRS field, and the clipping extraction worked. In my case this meant entering EPSG:4326, becuase that was the CRS of the input raster.

  • @25924637
    @25924637 2 года назад

    Can I use this method to clip an area from the Google Satelite base map?

  • @seaterrai8735
    @seaterrai8735 Год назад

    Cutline polygon is invalid why???

  • @veeranjaneyulukale2602
    @veeranjaneyulukale2602 2 года назад

    Why does the clipped raster doesn't match with the polygon when zoom in to pixel level?

    • @rashmiyadav987
      @rashmiyadav987 2 года назад

      Did u got any solution for this problem sir? I am facing the same issue...

    • @Inscissorr
      @Inscissorr 2 года назад

      @@rashmiyadav987 it might just be a rendering issue, have you tried setting the color gradient values as the original layer?

  • @dreamquarter
    @dreamquarter 3 года назад

    Why is it ok to clip using input layers with different CRS?

    • @geospatialschool
      @geospatialschool  3 года назад +1

      QGIS will reproject layers so they match. Sometimes this can cause problems. If results aren't turning out correctly it is often because of different CRS

    • @dreamquarter
      @dreamquarter 3 года назад +1

      @@geospatialschool Ok. I'm working on a project where I use rasters with different CRS. Before I clip them with a country-vector, I use the Warp tool to have them all in WGS 84.

  • @user-kd6mu3iu9r
    @user-kd6mu3iu9r 2 года назад

    Can't you name the file with polygon name?

  • @breeneco
    @breeneco 5 месяцев назад

    Thankyou!! This stuff isnt intuitive