Select to view content in your preferred language

QueryTask results cause problems with Viewer attribute table

2945
1
04-20-2012 03:31 PM
GerardoGarza
Occasional Contributor
I have a few different rest services I use to test viewer tools in my development environment.
One of the services, which exposes the Area and Length shape attributes, was causing an exception when I would query it and open the attribute table.
The service's layer has the default attributes of Shape.STArea() and Shape.STLength().  When the layer was queried, those attributes were returned and the attribute table threw an exception when opened.  Those fields, however, were not displayed in the attribute table.
I have another layer where those attributes are labeled with caps, SHAPE.STArea() and SHAPE.STLength(), but those are NOT returned by the QueryTask so attribute table does not complain.

Questions:

  1. Is this a bug with the API and/or the Viewer?

  2. What is the best practice for dealing with the shape attributes?  Hide them from the rest service or rename them?

Thanks, GG
0 Kudos
1 Reply
GerardoGarza
Occasional Contributor
I fixed this by hiding the feature's area and length attributes in the rest service.

I did not realize at the time I opened this thread that those attributes were specific to the SDE database holding the data.  In this case, I am using SQL Server spatial types, thus the STArea() and STLength() attribute names which I could not change, even by setting an alias.
0 Kudos