I've developed an application which loads the services from the ArcGIS Server via REST API.

I load a service, the service has multiple layers, each layer has multiple features (objects).

By the URL http://domain/arcgis/rest/services/Test/MapServer/3/query?f=json&where=1%3D1&returnGeometry=false&outFields=* I get all features of a layer.

When I click on the map, I get the Lat/long of the point. I want to load all features which contain this point. How should I generate the URL?

1 Answer 1


You would need to set the geometry parameter in the request, as described in the documentation here

Description: The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, for envelopes and points, you can specify the geometry with a simpler comma-separated syntax.


geometryType=esriGeometryEnvelope&geometry={xmin: -104, ymin: 35.6, xmax: -94.32, ymax: 41}



In general, if you're unsure about the specific format of the URL, open http://domain/arcgis/rest/services/Test/MapServer/3/query in a browser. This will give you the basic interface for querying a Mapservice. Press the Query button and inspect the resulting URL. If needed, you can trim unneeded parameters.

  • I tried this... If the features are polygons, and my point is [50,40], how should I generate the URL?
    – Leeloo
    Commented May 30, 2018 at 12:11
  • BTW your link doesn't work
    – Leeloo
    Commented May 30, 2018 at 12:12
  • The 3rd syntax example shows exactly that: geometryType=esriGeometryPoint&geometry=50,40
    – Berend
    Commented May 30, 2018 at 12:12
  • I fixed the URL
    – Berend
    Commented May 30, 2018 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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