Skip to main content

I’m trying to use two distinct services that complement each other.


First, I look for available dates with data, for a given date, from a given geographic space.


I get a list of dates that I leave a mark on the calendar, so the user can see which dates have data.


The second service I use is to process this same space in NDVI. However, the dates are not matching data on this second request.


First service (POST):


https://services.sentinel-hub.com/api/v1/catalog/search


{“bbox”:o-46.6492224651005,-17.14431645186469,-46.636052855246,-17.1357239057109],“datetime”:“2021-01-01T00:00:00Z/2021-12-12T00:00:00Z”,“collections”:“sentinel-1-grd”],“limit”:100,“distinct”:“date”}


Second service (GET):


https://services.sentinel-hub.com/ogc/wms/<client_id>?REQUEST=GetMap&BBOX=-17.14431645186469,-46.6492224651005,-17.1357239057109,-46.636052855246&LAYERS=NDVI&MAXCC=20&WIDTH=320&HEIGHT=320&FORMAT=image/jpeg&TIME=2021-11-01/2021-11-30&CRS=EPSG:4326


In the second service, the image goes back all red.


Where can the error be? Is there any extra parameter for when the second request is to fetch ndvi?

Any explanation of why I come back old?


If you need more details, let me know.

I had placed the incomplete requisition. I edited. On some dates the wms request is returning correct, for other dates, only the image is red in red.


I would like to have a list of dates for the service, where I knew they would have data, for that space.


Your catalogue API request is for “sentinel-1-grd” collection, which is radar (SAR).

The second request is, iam guessing, for Sentinel-2 (optical) as Sentinel-1 has no “NDVI” visualization.


So you might want to change
collections”:c“sentinel-1-grd”]

to
collections”:>“sentinel-2-l1c”]


If this is still not working for you, you will have to be a bit more specific in describing the problem…


Hi @jorgecultiveag,


It seems that you added a filter for maximum cloud coverage (the MAXCC part) in your wms request. The data could be filtered out if the cloud coverage of the tile exceeds the threshold you set for the filter.


I understood what you said but apparently it didn’t resolve.

What I need as a result is to process images in NDVI

But sometimes this image is returned only in red, no coloring and when I change the dates it returns correct. I would like to have available the dates that have data, for a certain geographic space.


Hi @jorgecultiveag ,


May I have your complete catalog and wms request and the date returned by the catalog that resulted in a complete red image? This would help me identify the issue you had. Thank you.


I made a catalog request for sentinel-2-l1c and sentinel-2-l2a (which have NDVI layer) over a time period between 2021-11-01 and 2021-11-30 (the request you made) and there was no tile with a cloud coverage lower than 20% (which was set in your wms request MAXCC=20).


You can either increase the maximum cloud coverage or search for a longer time period. For example, if you search for tiles with a cloud coverage lower than or equal to 50%, you will get 2 tiles returned (on 2021-11-05 and 2021-11-25). Then you can modify your request to the following and you will get the data:


https://services.sentinel-hub.com/ogc/wms/<client_id>?REQUEST=GetMap&BBOX=-17.14431645186469,-46.6492224651005,-17.1357239057109,-46.636052855246&LAYERS=NDVI&MAXCC=50&WIDTH=320&HEIGHT=320&FORMAT=image/jpeg&TIME=2021-11-01/2021-11-30&CRS=EPSG:4326

Hi @chung.horng,


thank you very much, this resolve me.


I only had one question: how did you manage to get the result of two dates [2021-11-05 and 2021-11-25]. In my request he answers more dates (the others don’t have data) and these two you mentioned have data.



Hi @jorgecultiveag ,


It is because you are searching for all available data in the time rage. For the two dates 2021-11-05 and 2021-11-25 the cloud coverage of the tiles is less than or equal to 50%. The other dates shown in your request have data as well, just with a cloud coverage greater than 50%.


If you remove the line "distinct": "date" you will see that the tiles on 2021-11-20, 2021-11-15, and 2021-11-10 have a cloud coverage of 94.66%, 98.03%, and 99.93%. These tiles are filtered out if you set MAXCC=20 or MAXCC=50 in your wms request, therefore you get a complete red image.


To search for data with a maximum cloud coverage of 50%, please try the following:


{
"collections": [
"sentinel-2-l2a"
],
"datetime": "2021-11-01T00:00:00Z/2021-11-30T23:59:59Z",
"bbox": [
-46.6492224651005,
-17.14431645186469,
-46.636052855246,
-17.1357239057109
],
"limit": 10,
"query": {
"eo:cloud_cover": {
"lte": 50
}
},
"distinct": "date"
}

For more detail of the catalog api please refer to our documentation.


Reply