I am currently getting confusing results from a spatial query with a polygon on a view based on a feature class.
Depending on the access (REST on Mapservice 10.6 with chrome or or ArcGIS Pro), I do get different results, both wrong. Expected are points all over Switzerland.
See following pictures.
1 ) the polygon :
2) the results with the REST Call
Only the region Geneva is delivered
3) the results with the query in ArcGIS Pro
Some features outside of the polygon are delivered (highlighted in red)
Does anyone have any suggestion as to why it fails?
The same query directly on the feature class deliver expected results.
A query with an envelope instead of a polygon on the view deliver expected results
Regarding the rest query, any query made on a map/feature service have a limited number of results returned by the server (usually 1000 or 2000 that can be configured on the service).
Without changing the configuration, there are way to iterate over the full result set to get every point (loop with resultOffset parameter)
The parameters are available here : https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm
For the ArcGIS Pro part, it does not seem a standard behavior, so I'd check the following :
Depending on the result, a contact with Esri support using you usual workflow could help pinpoint the problem.
Thanks for the input!
The max number of results is not the issue in this particular case (I should have mentioned it in the original post). the features are simple points, but some of them have a "null" geometry. I suspect that having empty geometries could also be a troublemaker.
The false results seem only to occur when both points are true:
* the layer is built on a view (--> queryLayer)
* the spatial element of the query is a polygon
Concerning ArcGIS Pro
I'll install the last version of ArcGIS Pro in the next days, so I'll be able to test it again. Queries with a simple filegdb do work as expected, since I do not have a view.
Before contacting Esri support, I'll have to find some time in order to create a self-contained example to send. But as soon as done, I'll link interesting information on this post.
Thanks, I should have known it would not be that simple ! However, the REST pic really looked like a feature limit problem.
Also, I guess you still have an ArcMAP laying around ? I'd also check if the querylayer behavior is the same.
In any case if you contact the support, please specify the version you are using for each products,the os, versions,the spatial reference, and the geometry data type.
I have not tried it myself but I am wondering if the issue could be coming from ArcGIS Pro calculating in WebMercator due to the basemap. Have you tried specifying "CH19013+" as the Output Coordinate System for the "Select Layer by Location" call in ArcGIS Pro (or whatever is the coordinate system of your polygon)?