Skip to main content

I am running the sentinel hub statistical script, specifically yhe bottom half with the code that reduces service processing costs. For some reason, the NDVI outputs are giving me the same number for the NDVI_min and NDVI_max. The reason for it doin this is that the sample count is 1 for every polygon even though they are all sizes of fields. Why is this happening and how can I increase the sample count

Statistical API doesn’t calculate statistics for each of your polygons, but for all your polygons together. Samples relate to acquisition dates. If you only get 1 sample count, this means that your time-range and aggregations are set in a way that you only get one result. For example, your time range is set to 1 day or your time range is set to 1 month, but your aggregations are also set to P30D, giving you 1 statistical calculation result for that month. If your time range was 1 month and your aggregation P1D, you would get statistical calculations for several days within that month.

If you would like to calculate statistics for each polygon separately, you will have to create a statistical request for each polygon. You can check this Python notebook to see how to do so.

I hope this helps,
 


I have ran your example and that is not the issue.


the problem I am getting is that the minimum and maximum NDVI is the same for every polygon per day. Why is this happening, I’d assume it because the Sen hub example has 9000 samples and my output is only producing one. Meaning, it has only taken one pixel.


I mainly just want to know how I can get an accurate min_NDVI and max_NDVI per polygon


my output -


I see what you mean. Would it be possible for you to share a statistical request for one of the polygons in CURL or Python? Or share the exact polygon coordinates and settings you used (time range, aggregation, evalscript). It will be much easier for us to figure out why you’re getting these results if we can recreate the exact case.


Problem is solved, there seems to be something wrong with your source code. The sample count only collects correctly if the CRS is 32633


Reply