1

I am using ArcGIS REST services from a server-side app and parsing the JSON response. I need information from several different layers on the same service, and my queries are always for points.

Is there a way to make a single request that amalgamates results from multiple layers?

At present I can meet my requirements by making multiple requests, for example to endpoints at

  • /arcgis/rest/services/foo/bar/MapServer/0/query?geometry=152.9259%2C-27.5516&geometryType=esriGeometryPoint&inSR=&spatialRel=esriSpatialRelIntersects...
  • /arcgis/rest/services/foo/bar/MapServer/2/query?...as above...
  • /arcgis/rest/services/foo/bar/MapServer/6/query?...as above...

My question is, am I missing some aggregated service that enables me to make a single request to multiple layers of the same service for the same spatial query?

1
  • I can imagine achieving some things via geoprocessing services. Can't think of other options. – Miro Oct 6 '20 at 11:46
2

Simply - No.

You can "query", and by query, I mean do a Map Export on a mapservice to get an IMAGE of all the layers. Eg. http://sampleserver6.arcgisonline.com/arcgis/rest/services/Water_Network/MapServer/export?

But to do an attribute query you must do it on each layer individually. The RESTful contract when making a query needs to be pretty well defined. I surmise that a query on the entire service would need to allow for a lot of 'what-if'. It's unlikely each layer would have the same attributes, so how could the client application expect certain attributes in a response? By doing per layer, where there is a complete layer definition, the app can get this list of attributes before making the request and know what will come back.

1
  • Thanks, good to get a clear answer and not die wondering :) – sasfrog Oct 6 '20 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.