Clarification and Verification Needed for 'max_size' Parameter in /cog Endpoint #798
-
Hi there. My name is KBAE and data engineer. In the /cog documentation (/cog docs), it mentions a parameter called max_size. However, when checking the /cog/statistics endpoint, the default value for max_size is stated as 1024, but this information doesn't seem to reflect in the actual codebase. During testing, differences were observed when using 1024 as the argument and when not. It would be beneficial to verify this inconsistency. Additionally, clarity is needed regarding what max_size precisely represents. Finding information about its units and the nature of the data it refers to has proven difficult in the documentation. Your attention to this matter would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
dear @kbae1230 in the documentation (https://developmentseed.org/titiler/endpoints/cog/#statistics) we say;
in the code base: titiler/src/titiler/core/titiler/core/factory.py Lines 405 to 415 in ffd67af the statistics endpoint has couple of dependencies ☝️, one of them is the which default to titiler/src/titiler/core/titiler/core/dependencies.py Lines 337 to 348 in ffd67af where 1024 is defined as default for the max-size
Can you share a reproducible example, passing or not passing max_size=1024 shouldn't have any influence when not passing |
Beta Was this translation helpful? Give feedback.
-
I confirmed that the 'max_size' parameter is not set a default in REST API post call. Additionally, I have also clarified the units and representation of the argument. |
Beta Was this translation helpful? Give feedback.
🤔 can you share the titiler version you are using, and also the full API call you are doing?
I assumed you were using the
/statistics [GET]
endpoint but maybe you are using the/statistics [POST]
with a GeoJSON feature, for which we don't have a defaultmax_size
set (https://github.com/developmentseed/titiler/blob/main/src/titiler/core/titiler/core/dependencies.py#L351-L362).The unit is in
pixel/cells
, it represent the maximum size (height or width) in which we wan to read the data into. This is to avoid having to fetch the full file. This is up to the user to set in thePOST
endpoint bec…