AnsweredAssumed Answered

Query offline geodatabase: wrong results using SpatialQueryFilter properties SpatialRelationship and MaxRecordCount

Question asked by k.gispergmysynergis-esridist Employee on Mar 5, 2018
Latest reply on Jun 6, 2018 by k.gispergmysynergis-esridist

Dear Esri Team!


We implemented a query on an offline point feature layer (from a previously downloaded geodatabase) using


var query = new SpatialQueryFilter


                                               // Geometry geom is a polygon geometry from the sketch editor

                                                Geometry = geom,

                                               SpatialRelationship = SpatialRelationship.Intersects,



  var res = await featureTable.QueryFeaturesAsync(query);


according to the Esri samples.


We don't understand how the properties SpatialRelationship and MaxRecordCount work.


1) for polygon / polyline FL the property SpatialRelationship.Intersects returns the results as expected– this is OK.


2) But while using  the property SpatialRelationship.Intersects for point FL, a strange behaviour occurs. If we additionally use the query.MaxRecordCount=300 property, the query returns a subset of (arbitrary?) points within the geometry, but without exceeding the limit. In this area there are almost 4000 points, but it returns for example only 243 points, and the result object returns res.IsTransferLimitExceeded = false; We expected an result with exactly 300 features, and res.IsTransferLimitExceeded = true;

If we repeat the query with the same geometry and without the query.MaxRecordCount limit, everthing seems to be alright and 2497 features are returned.


3) We tried the  SpatialRelationship.EnvelopeIntersects for point feature layers then,  and the results concerning the limit seem to be OK.

But unfortunately another odd error happens: It is not just that all points in the given geometry (and its extent) are returned, but even the points that have been moved far outside this geometry (+extent) in a previous step. This is quite strange. The same behavior, if you use SpatialRelationship.Contains for example. Only using the property SpatialRelationship.Intersects  returns the correct results in this case.


So whatever we use, the results aren't correct. In one case too few points, in the other too many (and outside the geometry).

We use ArcGIS Runtime 100.1.0 (and 100.2.0), ArcGIS Server 10.6, .NET Framwork 4.5.2, VS 2015, Windows 10


Thanks in advance,