I’m having trouble chaining this together, but here is what I’d like to accomplish:
It’s only step 3 that I’m stuck on. Do I somehow need to loop through every pixel in the current extent and test them individually using geometryEngine’s “within” before adding to an array?
I need to do this client-side and can’t perform a server-side rendering rule clip.
I appreciate any help you can provide!
Another idea, not sure if this is possible:
Create an ImageryLayer I use just for the analysis (with the same raster source), which then gets clipped with a client-side rendering rule…and then get values of all pixels in that layer after the clip?
I don't have a running sample at hand, but I believe you should be able to do something like that using the following:
For ImageryLayers: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#fetchIma...
For TiledImageryLayers: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html#fetc...
Use the extent of the sketched geometry as an input for these methods. As you describe above, you could then for each point / pixel in the response use the geometry engine to determine if it is part of the original geometry.
Hope this helps!