Clip with .shp?

Hi,

First time SNAP user. I’m wondering if it’s possible to clip all bands Sentinel-2 image to a shapefile and then export the result?

Also I can import the .shp but can’t zoom to it (it can be hard to find). Can this be done?

Sorry if these are really basic questions, very new here.

Thanks

Clipping by a shapefile is not so easy. Making it easier is on the todo list since quite some time.

If you want to do it only for one scene you can do the following:

  1. Resample the data to a common resolution
  2. Import the shape file
  3. You can zoom to the region by clicking on image either in the Mask Manager or the Layer Manager. In both you can select an item corresponding to the imported region.
  4. Now you can further zoom in
  5. Use “Spatial Subset from View” to clip the data

If you want to do it on a batch of products you should use gpt, the command line tool of SNAP. But you have to convert the shapfile into WKT before.
For more info on GPF/gpt please have a look at the help:


There is also some additional information in our wiki:
Bulk Processing with GPT - SNAP - SNAP Wiki (atlassian.net)

1 Like

Thanks! Marked as solution even though I haven’t tried it because it looks like the thing to do. Being new at this I’m just going to find another way without actually clipping to the .shp. Thanks again.