Polygon shapes and custom scripts in EO Browser

Is it possible to get the coordinates of polygons drawn with the “area of interest” tool in EO browser? I would like to use the polygons in custom scripts to get different effects on the areas inside and outside of the polygons. For example to render the area outside the polygon grayscale and area inside in colour, so that focus will be on the area inside the polygon. Would be a nice effect to use on timelapses to avoid changes outside of the area of interest distracting from what is happening inside the area of interest.

I would like to do something like this:

if(insidePolygon)
  return[2.5*B04, 2.5*B03, 2.5*B02]
}
else{
  return[1.5*B04, 1.5*B04, 1.5*B04]
}

If it is not possible to use the drawn polygons in custom scripts, would it be possible to define a shape with javascript for the same kind of use and decide the position of the shape with the longitude and latitude coordinates?

Hi @andergol,

it is not possible to use geometries within the Custom script as the script is evaluater on pixel-by-pixel basis.
What you could do, however, is to import a data mask layer using “Bring your own data” and then perform “Data Fusion” to check, whether the pixel is “in” or "not. It does take a bit of effort though.

Another (non-optimised) approach would be to request two images; one with bounding box requesting desaturated image, another with geometry (not bbox), making everything else transparent, and then overlaying them.

Thank you for your replies, gmilcinski and batic. I’m new to EO Browser, but I think both solutions cannot be done directly within EO Browser and requires using requests builder? When trying to login to request builder I get an “invalid account” message, so I am unable to send requests. But would it be possible to create timelapses like the ones in EO Browser with requests builder?

It seems that it will be quicker for now to just download the timelapse from EO Browser and just manipulate it with some other tool. But it is still a very cool feature:)

To use Request Builder, you will need Sentinel Hub account, which you can create here:
https://apps.sentinel-hub.com/dashboard/

Request Builder does not have a dedicated time-lapse feature so I am not sure it will do much good in your case.

Solution proposed by @batic can be done in EO Browser - you just tweak Custom scripts for each of the time-lapses. But you need some post-processing later on anyway.

I do have a Sentinel Hub account, but when I go to the dashboard it says my account is expired and asks me to upgrade it. I can still use login with EO browser to save pins etc., but not with request builder.

Would the bounding and geometry boxes be created using longitude/latitude coordinates? Do you have an example of how the boxes can be made in a way that would run in custom scripts?

Ah, I imagine that you’ve had trial Sentinel Hub account, which expired. You can indeed use EO Browser as this is not tied to the Sentinel Hub subscription.

You will find examples on how to do advanced time-lapses here:

That said, you will need Sentinel Hub account for that…