When you POST to /api/raster/collections/{id}/items/{id}/statistics with a small geojson containing a Polygon it works just fine:
echo '{"type": "Feature", "properties": {"ADMIN": "France", "ISO_A3": "FRA"}, "geometry": {"type": "Polygon", "coordinates": [[[-5.183429, 42.332925], [8.233998, 42.332925], [8.233998, 51.066135], [-5.183429, 51.066135], [-5.183429, 42.332925]]]}}' > simple.json
curl -H "Content-Type: application/json" --data @simple.json https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202307_Col3_V4.nc/statistics
Response:
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-5.183429,42.332925],[8.233998,42.332925],[8.233998,51.066135],[-5.183429,51.066135],[-5.183429,42.332925]]]},"properties":{"statistics":{"cog_default_b1":{"min":-1556922155139072.0,"max":5875976969912320.0,"mean":908950033553932.1,"count":11880.0,"sum":1.0798326398620713e+19,"std":662287275047051.9,"median":790465041399808.0,"majority":322760819605504.0,"minority":-1556922155139072.0,"unique":11879.0,"histogram":[[16,298,4477,5071,1360,478,142,37,0,1],[-1556922155139072.0,-813632229212160.0,-70342303285248.0,672947555532800.0,1416237548568576.0,2159527541604352.0,2902817266204672.0,3646107527675904.0,4389397252276224.0,5132686708441088.0,5875976969912320.0]],"valid_percent":100.0,"masked_pixels":0.0,"valid_pixels":11880.0,"percentile_2":-156033125187584.0,"percentile_98":2714252632653824.0}},"ADMIN":"France","ISO_A3":"FRA"}}
But when you use a bigger geojson in the body (this one is a MultiPolygon) it hangs:
curl https://geodata.ucdavis.edu/gadm/gadm4.1/json/gadm41_FRA_0.json | jq ".features[0]" > complex.json
curl -H "Content-Type: application/json" --data @complex.json https://openveda.cloud/api/raster/collections/no2-monthly/items/OMI_trno2_0.10x0.10_202307_Col3_V4.nc/statistics
Context
I ran into this issue while running https://github.com/NASA-IMPACT/veda-docs/blob/main/user-guide/notebooks/quickstarts/timeseries-stac-api.ipynb in the VEDA docs for NASA-IMPACT/veda-docs#235
When you POST to
/api/raster/collections/{id}/items/{id}/statisticswith a small geojson containing aPolygonit works just fine:Response:
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-5.183429,42.332925],[8.233998,42.332925],[8.233998,51.066135],[-5.183429,51.066135],[-5.183429,42.332925]]]},"properties":{"statistics":{"cog_default_b1":{"min":-1556922155139072.0,"max":5875976969912320.0,"mean":908950033553932.1,"count":11880.0,"sum":1.0798326398620713e+19,"std":662287275047051.9,"median":790465041399808.0,"majority":322760819605504.0,"minority":-1556922155139072.0,"unique":11879.0,"histogram":[[16,298,4477,5071,1360,478,142,37,0,1],[-1556922155139072.0,-813632229212160.0,-70342303285248.0,672947555532800.0,1416237548568576.0,2159527541604352.0,2902817266204672.0,3646107527675904.0,4389397252276224.0,5132686708441088.0,5875976969912320.0]],"valid_percent":100.0,"masked_pixels":0.0,"valid_pixels":11880.0,"percentile_2":-156033125187584.0,"percentile_98":2714252632653824.0}},"ADMIN":"France","ISO_A3":"FRA"}}But when you use a bigger geojson in the body (this one is a
MultiPolygon) it hangs:Context
I ran into this issue while running https://github.com/NASA-IMPACT/veda-docs/blob/main/user-guide/notebooks/quickstarts/timeseries-stac-api.ipynb in the VEDA docs for NASA-IMPACT/veda-docs#235