AnsweredAssumed Answered

Spatial Query For Points Within Polygon

Question asked by ARUtility on Oct 2, 2018
Latest reply on Oct 2, 2018 by rscheitlin

I'm having a lot of trouble running a spatial query to find all features that intersect with a polygon.

 

I've got a hosted feature service made up of polylines that represent water mains in a distribution system. What I'm trying to do is a spatial query that takes a polygon, made up of a series of latitudes and longitudes, and finds all features of the hosted feature service that intersect (or fall within) that polygon. I've been using the query tool on the service url to help troubleshoot and this is what I'm doing right now:

 

 

 

The beginning point and ending point are the same as required, I know you can't see it in the screenshot. One interesting thing is that this requires a WHERE clause to run. To work around this I've place "1=1" in the where clause so that I get all of the results. The problem here is that I literally get every single feature, not just what intersects the polygon.

 

Is there any way to achieve what I'm after? I have searched stackoverflow, geoNet and google for many hours and tried many iterations and cannot for the life of me get this to work. Any help is appreciated!

Outcomes