So, I finally contacted ESRI Support about this one and received the following response (after a few back and forths for clarification):
Unfortunately, we couldn't find an out-of-the-box way to do this.
I wanted to discuss your options, which are mainly:
- GP service
- SOE
- Separate web service
- Client-side querying
We had a further discussion re: those options over the phone. For various reasons (e.g., performance at runtime is inadequate using a GP service or doingclient-side querying because the tables involved are huge and it would take to long to transfer their entire content), we basically came down to the realization that what I was doing, as a general approach, was probably the best we could do.
However, because I didn't want to have two services running for every one of the rasters involved, I did make one alteration to my design. I create a MapService with a File Geodatabase dynamic workspace that I use to simply access copies of the raster attribute tables that I have placed in there.
Basically, I do something like this:
var strLayer = JSON.stringify(
{
"source":{
"type": "dataLayer",
"dataSource": {
"type": "table",
"workspaceId":"cr_rc",
"dataSourceName": "crop_rotations_table"
}
}
}
);
var queryTask = esri.request(
{
url: "http://<domain>/atlas/rest/services/dynWS/MapServer/dynamicLayer/query"
,handleAs: "json"
,callbackParamName: "callback"
,content:{
f:"json"
,layer: strLayer
,where: "\"CODE2011\"=167 AND \"CODE2012\"=147"
,outFields: "VALUE, COUNT, CROP2011, CROP2012, CROP2013, CROP2014"
,orderByFields: "COUNT DESC"
}
}
);
queryTask.then(
function(response){
if (response.features && response.features.length > 0){
// doSomething
}
else {
console.log("No features returned");
}
}
,function(error){
console.log("Error: " + error);
}
);
Just adding this info in case someone else goes looking.
Cheers,
jtm