Select to view content in your preferred language

ArcGIS Online REST Feature Layer Query: specifying distance returns no results??

5116
2
Jump to solution
02-17-2016 11:48 AM
AZendel
Frequent Contributor

I am trying to query against this public feature service (point geometry):  http://services2.arcgis.com/Gypl21NmiWS1cM7h/ArcGIS/rest/services/TrafficCounts/FeatureServer/0

When I input the exact coordinates for a station, that station is returned:

http://services2.arcgis.com/Gypl21NmiWS1cM7h/arcgis/rest/services/TrafficCounts/FeatureServer/0/quer...

But if I add 2000 to the 'distance' parameter, I get no results:

http://services2.arcgis.com/Gypl21NmiWS1cM7h/arcgis/rest/services/TrafficCounts/FeatureServer/0/quer...

I've tried this with WKID 102100  as well.  Same behavior.  There are other stations within 2000 meters of that station, as shown below.  Any idea what is causing this?

Capture.JPG

0 Kudos
1 Solution

Accepted Solutions
KyleBalke__GISP
Frequent Contributor

Try changing your Spatial Relationship from Within to Intersects

View solution in original post

0 Kudos
2 Replies
KyleBalke__GISP
Frequent Contributor

Try changing your Spatial Relationship from Within to Intersects

0 Kudos
AZendel
Frequent Contributor

That did the trick.  I was thinking that the "within" spatial relationship option that maps to esriSpatialRelWithin meant "are within distance of" like the option in the "Select by location" dialog in ArcMap.  As did one of my co-workers.  If any ESRI folks read this, consider changing "within" to "contained within" on the HTML form.  I realize that changing esriSpatialRelWithin to something else will break code all over the world and is therefore infeasible. 

0 Kudos