Subset several images on a same area

I am also having this question…

I have several S2 images, that I would like to subset all to the same area, and after processing and do everthing I want with them, I would like also to subset S1 data, for the same location/area.

But to beggin with , I don’t know how to do it with the S2:

  1. I tried with graph builder in order to apply always the same ‘cut’, but it did not work
  2. I can do, all one by one, but isn’t there a simples way of doing it?

Thanks!

1 Like

I think first of all if you are not interested in the whole image then before starts to think in subset, why you don’t try out sub swath in case of IW, S1 A\B, and then apply orbit file and then corregistration and then subset, to reach your study area precisely .

But I’m now just focusing on S 2 images for now…

I have no clue about S2 because I didn’t use before, but let tell you personal opinion might be helpful

Try out to find out your study area and then determine the upper left (X, Y ) What ever they are pixels or … and the lower right (X, Y) and apply for all your image and create your new subset.

1 Like

Ok thanks @falahfakhri

For S2 it should be possible to simply use the Subset operator, but you have Resample the S2 data to a common resolution before. To do this, you can use Resample operator. So a graph would have just two nodes node.
See GeoSubsetOfS2.xml
I did not let the graph run. But, in general, it should work. After specifying the geoRegion Parameter.

1 Like

That what I meant exactly as marpet says

1 Like

Thanks for the reply @marpet.
I will give my feedback when possible.

Hi marpet,
how to fill the lat long values for my study area, as it not a rectangle.
POLYGON(( , , …, )

To correct my self.
The graph must be called like

gpt GeoSubsetOfS2.xml -t "G:\EOData\temp\S2Subset.dim" -PsourceFile="G:\S2\S2A_MSIL1C_20160914T074612_N0204_R135_T36JTT_20160914T081456.SAFE\MTD_MSIL1C.xml"

I don’t understand what you want to do.
You product has already geo-coordinates. No need to fill the shape.
You want to extract the coordinates as raster?

Hi marpet,
In georegion we need to specify the bounds of the shapefile. So we need to convert the shape file to WKT format and the provide the values in POLYGON(( , , …, ). The question I was asking you is how to created the bounding values.
Anyways I have solved it by using the qgis plugin which convert the shape file to WKT format.

Subset POLYGON(( , , ..., )

OK, now I got it.
If you have imported the shapefile in the GUI. You can open a image view, display the shapefile and select the geometry. Then do a right-click on the image view and select from the context menu WKT from Geometry

Thanks marpet. wkt from geometry is not highlighting. But when I double click the shape file its details are displayed.

Probably you need to select the selection tool first and then select the geometry. Afterwards the entry in the context menu should be enabled.

Hi,

I would also like to subset several S3 OLCI images to exactly the same area. Some of the images are obtained from different passes and so I haven’t been able to subset the area using the same geo coordinates.
Is there a way to subset S3 OLCI images obtained from different passes to exactly the same area in SNAP?

Many thanks,

Emma

You mean that the result has always the same size regardless how much you area overlaps with the source product?
This is possible but not with the subset operator. This cuts only the overlapping region.

You can create one template product which covers the full area.
This does not need to contain all the data. Just one band is sufficient.
Then you can use the reprojection operator and the option “Use CRS of”
image
Select the reprojected template product here as reference.
This has the downside that the data is reprojected afterwards. Maybe this is what you want at the end anyway?

Another option is to use the collocation operator with the template product.
Here no reprojection is necessary but both, the template and the actual product are merged into one product. If you use a graph, then you can add a subset operation afterwards to remove the band from template product.

Apologies, I don’t think my question was clear:

I am trying to place pins over an area of interest and see how the albedo (calculated from the SICE Snow Properties processor) changes through time at the pins’ location. Each pass covers 100% of the area of interest but each pass doesn’t necessarily overlap the previous image perfectly. I have successfully subset the first image to the area of interest using specified geo coordinates. The problem I am having is that when the pass changes the pins are shifted to a different location. Is there a way to solve this on SNAP?

Thanks,

Emma

Okay, now I think I understood your problem.
The pins should actually not be shifted depending on the orbit. The geo-location remains the same.
Can you tell how big the shift is, in terms of pixel / km? Maybe you can attach a picture which depicts the shift. I assume you observed this shift on multiple products, right?
If it is only a small shift it might be due to the inaccuracy of the tie-points used to derive the geo-information of the product.
You can switch to a pixel-based geo-coding in the options of the S3TBX.


Maybe this helps.

1 Like

The shift is a couple of pixels and observed in multiple products.
I have switched to pixel-based geo-coding and it has solved the issue thank you for the suggestion.

1 Like