Skip to main content

Hello


Some images are returning cropped from Sentinel 2 API.


Here are some examples from 2022-08-10, KML file is attached.

Could you help me?




28a71bb3267184bafe53bb28ef65d94e.kml (2.7 KB)

Our code:


{

“input”: {

“bounds”: {

“properties”: {

“crs”: “http://www.opengis.net/def/crs/OGC/1.3/CRS84

},

“geometry”: {

“type”: “Polygon”,

“coordinates”:

/>-54.03679132462,-29.35832362421], -54.03637290001,-29.36217613810],]-54.03687715530,-29.36336365548],]-54.03669476509,-29.36378442603],]-54.03641581535,-29.36406493876],]-54.03611540794,-29.36394338334],]-54.03582572981,-29.36432674995],]-54.03520345688,-29.36450440716],]-54.03455972672,-29.36504672724],]-54.03457045555,-29.36445765529],]-54.03480648994,-29.36379377646],]-54.03455972672,-29.36353196390],]-54.03460264206,-29.36282132642],]-54.03421640396,-29.36285872852],]-54.03429150581,-29.36363481892],]-54.03395891190,-29.36380312690],]-54.03418421745,-29.36422389563],]-54.03431296349,-29.36485037030],]-54.03404474258,-29.36532723650],]-54.03367996216,-29.36563579579],]-54.0334868431972,-29.36557034390],[-54.03282165527,-29.36605655695],]-54.0321779251972,-29.36613135875],[-54.03226375580,-29.36684197313],]-54.03137326241,-29.36715052783],]-54.03093338013,-29.36751518218],]-54.03057932854,-29.36755258255],]-54.03213500977,-29.36181146463],]-54.03381943703,-29.36197977563],]-54.03593301773,-29.35835167702],]-54.03679132462,-29.35832362421]]

]

}

},

“data”: <

{

“type”: “S2L1C”,

“dataFilter”: {

“timeRange”: {

“from”: “2022-08-01T00:00:00Z”,

“to”: “2022-09-01T00:00:00Z”

},

“maxCloudCoverage”: 3

}

}

]

},

“output”: {

“width”: 349,

“height”: 512,

“responses”: {

{

“identifier”: “image”,

“format”: {

“type”: “image/png”

}

},

{

“identifier”: “userdata”,

“format”: {

“type”: “application/json”

}

}

]

}

}',‘evalscript’ => '//VERSION=3


function setup() {
return {
input: /"B02", "B03", "B04"],
mosaicking: Mosaicking.ORBIT,
output: { id:"image", bands: 3}
}
}

function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
outputMetadata.userData = { "metadata": JSON.stringify(scenes) }
}

function evaluatePixel(samples) {
return o 2.5*samplesa0].B04, 2.5*samplesd0].B03, 2.5*samplesf0].B02 ]
}

Hi @marcos ,


Your area of interest is at the border of tiles, so the returning data is not cropped but simply not covered your entire area on that specific acquisition (view on EO Browser).


You could use our Catalog API to search the available product on 2022-08-10 with Requests Builder using the following curl command and click Geometry to see the tile geometry (Fig 1):


curl -X POST https://services.sentinel-hub.com/api/v1/catalog/search 
-H 'Content-Type: application/json'
-H 'Authorization: Bearer <token>'
-d '{
"collections": [
"sentinel-2-l1c"
],
"datetime": "2022-08-10T00:00:00Z/2022-08-10T23:59:59Z",
"intersects": {
"type": "Polygon",
"coordinates": [
[
[
-54.03679132462,
-29.35832362421
],
[
-54.03637290001,
-29.3621761381
],
[
-54.0368771553,
-29.36336365548
],
[
-54.03669476509,
-29.36378442603
],
[
-54.03641581535,
-29.36406493876
],
[
-54.03611540794,
-29.36394338334
],
[
-54.03582572937,
-29.36432674995
],
[
-54.03520345688,
-29.36450440716
],
[
-54.03455972672,
-29.36504672724
],
[
-54.03457045555,
-29.36445765529
],
[
-54.03480648994,
-29.36379377646
],
[
-54.03455972672,
-29.3635319639
],
[
-54.03460264206,
-29.36282132642
],
[
-54.03421640396,
-29.36285872852
],
[
-54.03429150581,
-29.36363481892
],
[
-54.0339589119,
-29.3638031269
],
[
-54.03418421745,
-29.36422389563
],
[
-54.03431296349,
-29.3648503703
],
[
-54.03404474258,
-29.3653272365
],
[
-54.03367996216,
-29.36563579579
],
[
-54.03348684311,
-29.3655703439
],
[
-54.03282165527,
-29.36605655695
],
[
-54.03217792511,
-29.36613135875
],
[
-54.0322637558,
-29.36684197313
],
[
-54.03137326241,
-29.36715052783
],
[
-54.03093338013,
-29.36751518218
],
[
-54.03057932854,
-29.36755258255
],
[
-54.03213500977,
-29.36181146463
],
[
-54.03381943703,
-29.36197977563
],
[
-54.03593301773,
-29.35835167702
],
[
-54.03679132462,
-29.35832362421
]
]
]
},
"limit": 10
}'



Fig 1

Hi @chung.horng ,


I’ve encountered the same situation and would like to filter out the images that are “cut”.

In my case, I’m using CatalogAPI to search for all available features in a month interval ( by specifying the bbox) and then use ProcessAPI to download each individual image using a 24h interval and the actual geometry.


So, in order to filter out the incomplete images I have to use the CatalogAPI with “intersects” attribute and the geometry, instead of the bbox. Is this correct? Or is it also necessary to check the search results and compare each feature geometry with the original one?


Thank you!


Hi @de_accountspayable ,


It is necessary to check the search results and compare each feature geometry with the original one as you said.


The intersects attribute provides another way to search by any type of geometries instead of bbox, but the logic behind is still intersection.


Hi @chung.horng ,


Thank you for the information.


I’m now trying to use the “intersects” attribute and this is my CatalogAPI request:


{
"collections": o
"sentinel-2-l2a"
],
"datetime": "2022-08-31T00:00:00Z/2022-09-30T23:59:59Z",
"intersects": {
"coordinates": t


24.511650327795195,
47.379004741441705
],

24.54199667006762,
47.39688946627758
],

24.566845590436657,
47.37723101407217
],

24.541270758754507,
47.35778989131739
],

24.511650327795195,
47.379004741441705
]
]
],
"type": "Polygon"
},
"limit": 100
}

However, I’m not sure what to look for in the search result. When inspecting the geometries, the points geo coordinates seem to be slightly different from the ones I provide in the search request.

Here is an example for one of the assets in the search result.


        {
"assets": {
"data": {
"href": "s3://sentinel-s2-l2a/tiles/35/T/LN/2022/9/5/0/",
"title": "s3",
"type": "inode/directory"
}
},
"bbox": "
24.327940564369047,
46.83565300257248,
25.816635152903103,
47.84736201505866
],
"geometry": {
"coordinates": n



24.327940564369047,
47.82258644892732
],

24.377293022347263,
46.83565300257248
],

25.816635152903103,
46.859591943819815
],

25.794341834121656,
47.84736201505866
],

24.327940564369047,
47.82258644892732
]
]
]
],
"crs": {
"properties": {
"name": "urn:ogc:def:crs:OGC::CRS84"
},
"type": "name"
},
"type": "MultiPolygon"
},
"id": "S2B_MSIL2A_20220905T091559_N0400_R093_T35TLN_20220905T105108",
"links": l
{
"href": "https://services.sentinel-hub.com/api/v1/catalog/collections/sentinel-2-l2a/items/S2B_MSIL2A_20220905T091559_N0400_R093_T35TLN_20220905T105108",
"rel": "self",
"type": "application/json"
},
{
"href": "https://services.sentinel-hub.com/api/v1/catalog/collections/sentinel-2-l2a",
"rel": "parent"
},
{
"href": "https://scihub.copernicus.eu/dhus/odata/v1/Products('adbd0ca9-d877-4371-bc64-d40854c8eb75')/$value",
"rel": "derived_from",
"title": "scihub download"
}
],
"properties": {
"constellation": "sentinel-2",
"datetime": "2022-09-05T09:27:21Z",
"eo:bands": b
{
"center_wavelength": 0.4427,
"common_name": "coastal",
"full_width_half_max": 0.021,
"name": "B01"
},
{
"center_wavelength": 0.4924,
"common_name": "blue",
"full_width_half_max": 0.066,
"name": "B02"
},
{
"center_wavelength": 0.5598,
"common_name": "green",
"full_width_half_max": 0.036,
"name": "B03"
},
{
"center_wavelength": 0.6646,
"common_name": "red",
"full_width_half_max": 0.031,
"name": "B04"
},
{
"center_wavelength": 0.7041,
"full_width_half_max": 0.015,
"name": "B05"
},
{
"center_wavelength": 0.7405,
"full_width_half_max": 0.015,
"name": "B06"
},
{
"center_wavelength": 0.7828,
"full_width_half_max": 0.02,
"name": "B07"
},
{
"center_wavelength": 0.8328,
"common_name": "nir",
"full_width_half_max": 0.106,
"name": "B08"
},
{
"center_wavelength": 0.8647,
"common_name": "nir08",
"full_width_half_max": 0.021,
"name": "B8A"
},
{
"center_wavelength": 0.9451,
"common_name": "nir09",
"full_width_half_max": 0.02,
"name": "B09"
},
{
"center_wavelength": 1.6137,
"common_name": "swir16",
"full_width_half_max": 0.091,
"name": "B11"
},
{
"center_wavelength": 2.2024,
"common_name": "swir22",
"full_width_half_max": 0.175,
"name": "B12"
}
],
"eo:cloud_cover": 68.85,
"eo:gsd": 10,
"instruments": m
"msi"
],
"platform": "sentinel-2b",
"proj:bbox": :
300000,
5190240,
409800,
5300040
],
"proj:epsg": 32635,
"proj:geometry": {
"coordinates": n



300000.9998340354,
5300039.000220574
],

300000.9998549018,
5190241.000192826
],

409798.99999943626,
5190241.000194071
],

409798.9999993569,
5300039.000221773
],

300000.9998340354,
5300039.000220574
]
]
]
],
"crs": {
"properties": {
"name": "urn:ogc:def:crs:EPSG::32635"
},
"type": "name"
},
"type": "MultiPolygon"
}
},
"stac_extensions": s
"eo",
"projection"
],
"stac_version": "0.9.0",
"type": "Feature"
},

I get 22 features in total for this CatalogAPI search, some of them have similar geometry with my original Polygon, but the coordinates seem to be a bit different. Am I doing something wrong in my request?


Thank you!


Hi @de_accountspayable ,


You’re doing it correctly. The attribute geometry as shown below is the tile geometry.




de_accountspayable:


"geometry": {
"coordinates": :



24.327940564369047,
47.82258644892732
],

24.377293022347263,
46.83565300257248
],

25.816635152903103,
46.859591943819815
],

25.794341834121656,
47.84736201505866
],

24.327940564369047,
47.82258644892732
]
]
]
],
"crs": {
"properties": {
"name": "urn:ogc:def:crs:OGC::CRS84"
},
"type": "name"
},
"type": "MultiPolygon"
}



This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.


Reply