Select to view content in your preferred language

ArcGIS Server 11.5 query problem

260
3
2 weeks ago
LarsSøe
Occasional Contributor

 

I’m experiencing what appears to be inconsistent spatial query behavior in ArcGIS Server 11.5 against a polygon feature class stored in SQL Server.

I would like to know whether this is expected behavior, a known limitation, or potentially a bug.

Environment:

  • ArcGIS Server / Enterprise 11.5
  • SQL Server enterprise geodatabase
  • Layer is a normal polygon feature class (not a query layer/view)
  • Query performed against /MapServer/{layerId}/query
  • Spatial relation: esriSpatialRelIntersects
  • Geometry type: esriGeometryMultipoint
  • Requests are sent using POST
  • Spatial index rebuilt
  • Statistics updated
  • Feature class extent recalculated
  • Service restarted

The issue:
Individual point queries work correctly.

However, when multiple points are combined into a single multipoint geometry, ArcGIS Server starts returning inconsistent results.

The strange part is:
Adding additional points can REMOVE previously returned OBJECTIDs from the result set.

https://servername/webgis/rest/services/Int/NG_Intern/MapServer/188/query

Post body:

{
"where": "1>0",
"geometry": {
"points": [
[518458.872, 6091340.096],
[529008.6611, 6096497.8727],
[518340.468, 6091537.346]
],
"spatialReference": {
"wkid": 25832
}
},
"geometryType": "esriGeometryMultipoint",
"inSR": 25832,
"spatialRel": "esriSpatialRelIntersects",
"units": "esriSRUnit_Meter",
"outFields": "objectid",
"returnGeometry": true,
"returnTrueCurves": false,
"returnIdsOnly": false,
"returnCountOnly": false,
"returnZ": false,
"returnM": false,
"returnDistinctValues": false,
"returnExtentOnly": false,
"sqlFormat": "none",
"returnUniqueIdsOnly": false,
"featureEncoding": "esriDefault",
"f": "json"
}

Example 1 — returns 3 polygon features:

{
"points": [
[518458.872,6091340.096],
[529008.6611,6096497.8727],
[518340.468,6091537.346]
],
"spatialReference": {
"wkid": 25832
}
}
 

Example 2 — same points + one additional point:

 

{
"points": [
[518458.872,6091340.096],
[529008.6611,6096497.8727],
[518340.468,6091537.346],
[521703.189,6102741.1]
],
"spatialReference": {
"wkid": 25832
}
}
 

This second query returns only 1 polygon feature???

The polygons returned from Example 1 disappear completely in Example 2, even though all original points are still included.

This seems logically incorrect - or am I missing something?

I can also reproduce similar behavior using multipart polygon geometries (rings) instead of multipoints.

Additional observations:

  • Results appear sensitive to point order
  • Individual point queries always return correct polygons
  • Problem only occurs with combined geometries

Has anyone seen similar behavior with:

  • ArcGIS Server MapServer query engine
  • SQL Server spatial backend
  • multipoint or multipart geometries
  • candidate pruning / spatial indexing

I’m especially interested in whether:

  • this is a known bug/limitation of MapServer queries
  • there are known bugs related to spatial decomposition multipoint geometries

Thanks.

0 Kudos
3 Replies
LarsSøe
Occasional Contributor

@TanuHoque Should I report this as a potential bug?

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

You could publish the same service using a different back-end data source, e.g., file GDB instead of SQL Server, to see if the issue is isolated to a particular type of data source.

TanuHoque
Esri Regular Contributor

@LarsSøe 

yes, pls open a ticket and we will take a look at this. I can't say much with the trying with the exact data. Thank you!

Also I do agree with Joshua. If you don't mind, please give this a try with file gdb and see how it behaves.

Thank you.