Select to view content in your preferred language

How to find polygons inside specific boundary?

380
1
12-21-2023 11:34 PM
aydemiremrah
Occasional Contributor

Hello, there is a map service service with thousands of parcels. I need to find polygons in a specific boundary by sending a query to this service. How can I do this using rest api? Actually, boundary is a Grid service included in this service. I need to find polygons in any grid.

0 Kudos
1 Reply
TanuHoque
Esri Regular Contributor

@aydemiremrah 

here is what you can do:

  1. make a query call to your boundary layer to get the geometry of the specific grid/boundary that you want use to find all parcels.

  2. use the geometry returned from the above request, in another query call that you will make to your parcel layer. This time you will use that geometry as the search geometry. And this will return all parcels that are within or interested by the grid/boundary depending on what spatialRel operator that you use

 

Example:

  1. finding a county named Jackson from Missouri. 
    https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/3/query?where=NAME+%3D+%27... 

  2. using the geometry of Jackson county to find all cities (point features) that are within Jackson county
    https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0/query?geometry=%7B%22rin... 
  3. returned results of the final query looks like this:
    TanuHoque_0-1703284816002.png

     

hope this helps.

0 Kudos