Raster Layer > Query for Extent

11-26-2019 08:02 AM
Occasional Contributor


Is it possible to query for extent a Raster Layer (as a MapImageLayer sublayer) ?

For other types of sublayers I'm using QueryTask and the executeForExtent method and it works ok (below), however I'm getting an error when querying Raster Layers "{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}". I have tried various combination of queries to no avail.

As an example how would you query fo extent the hillshade raster in this sandbox example? ArcGIS API for JavaScript Sandbox  , when looking at the rest endpoint it has "Supports Returning Query Extent: true" , so it might be possible?

const query = new Query({
   outSpatialReference: spatialReference.wkid,
   geometry: view.extent
const queryTask2 = new QueryTask({
0 Kudos
2 Replies
Esri Regular Contributor

Hi there, 

QueryTask is returning an error because ImageService REST end point does not support `returnExtentOnly` option with Query operation. The SDK document for executeForExtent explains this method only works for feature services and map service layers. 

Hope this helps,


0 Kudos
Occasional Contributor

Yes that's a map service layer I'm trying to query for extent.

0 Kudos