Query Polygon Intersection, exclude adjacent polygons or slight overlap?

635
2
Jump to solution
08-24-2022 11:47 AM
JasonWood
New Contributor II

Please refer to this query result:

https://services2.arcgis.com/EFg39h3DBNzpxORa/ArcGIS/rest/services/Riverview_Zoning/FeatureServer/1/...

As you can see, this returns 2 polygons.

The input geometry is represented by the teal rectangle in this picture. The results are the yellow polygon and the blue polygon.

JasonWood_1-1661366781570.png

 

I do not want the blue polygon returned as it does not extend inside my input geometry.

I tried setting the distance to -1 meters. I thought this would shrink the input geometry by 1m and therefore effectively require any query matches to extend at least 1m inside the provided boundary, but negative numbers in distance do not seem to have any effect.

Is there any way to adjust my query so that it excludes such matches?

0 Kudos
1 Solution

Accepted Solutions
JasonWood
New Contributor II

I solved this by first using the Buffer geometry service with a negative distance to slightly reduce the size of the polygon. Then I use that result in my query. I would rather get it all done with one API call but if that's impossible, this is a good solution.

View solution in original post

0 Kudos
2 Replies
JasonWood
New Contributor II

I solved this by first using the Buffer geometry service with a negative distance to slightly reduce the size of the polygon. Then I use that result in my query. I would rather get it all done with one API call but if that's impossible, this is a good solution.

0 Kudos
liqiuping
New Contributor II

hi. i've come across the same issue. and i would filter those queried features. like this :

const realFeatures = features.filter(
          ({ geometry }) => !geometryEngine.touches(queryGeometry, geometry),
        );