Sentinel2 Mask Bands (Created With GeoJson Polygons Points) Does Not Mark Correct Regions

Hello, I am working on extracting Sentinel-2 bands using a shapefile that contains the coordinates of my country’s region. To manage this, I divided the large region into smaller tiles using the “UtmZoneSplitter” function. Initially, I set the box size parameter to 5000, but I noticed that the geojson polygons did not align correctly with the Sentinel-2 RGB band data when I plotted them.

Upon encountering this issue, I adjusted the box size parameter to 2500, which resulted in a correct match. I initially expected this parameter to only affect the number of tiles, but I observed that it also altered the coordinates of the bounded region within the returned values. When I tried to work with larger tiles, the geojson seemed to incorrectly calculate the polygon coordinates according to the tiles.

I am looking for a solution to ensure the coordinates match correctly regardless of box size. Or is there a way to calculate or transform the correct coordinates according to this parameter change? Additionally, I am curious to understand why changing the box size parameter causes such a difference in coordinate calculation.

1 Like

Hi @gokhankaraahmetoglu!

Additionally, I am curious to understand why changing the box size parameter causes such a difference in coordinate calculation.

Indeed, this doesn’t seem to be expected. In order to make it easier to help you, would it be possible if you provide the shapefile you are working with and the minimal-working-example of the code you used which resulted in non-aligned bboxes?

Thank you!