REST query using Shape attribute

4223
2
Jump to solution
02-18-2015 12:33 PM
SimonHodge
New Contributor III

Hi,

I'm trying to query a REST map serviced using the Shape attribute and it doesn't return any results.  I'm doing this from the JavaScript API using the FindTask with search field set to Shape and the search text set to a shape type e.g. Point, Polyline or Polygon.  None are returned.  However, when you examine the result of a search for something else, it does contain a Shape attribute with one of the given values.  I've also confirmed it's not working using the REST endpoints 'query' page.

My guess is this is a limitation of the REST service, probably something to do with the shape field being of type esriFieldTypeGeometry rather than a plain string type.  Can anyone confirm that it is a limitation, or whether it should in fact work but that I'm therefore doing something wrong?

Thanks

0 Kudos
1 Solution

Accepted Solutions
OwenEarley
Occasional Contributor III

The shape field is a geometry and cannot be compared to a string. ESRI often displays the geometry type in the field value - for example in the ArcMap feature class attribute table.

Why are you attempting to search on geometry type? - there may be an alternative way to do what you are after.

View solution in original post

2 Replies
OwenEarley
Occasional Contributor III

The shape field is a geometry and cannot be compared to a string. ESRI often displays the geometry type in the field value - for example in the ArcMap feature class attribute table.

Why are you attempting to search on geometry type? - there may be an alternative way to do what you are after.

SimonHodge
New Contributor III

Hi,

Thanks for the answer and sorry for the delay.  I suspected that might be the case.  The issue was found by our test team as they were testing the search based on the properties of a number of sample features and Shape was one of those properties.  Therefore, in the real world scenario, there may well not actually be a use case for needing to search on the Geometry attribute so we are just going to park it as a known issue.

Again, thanks.

0 Kudos