Cannot Access SHAPE.area Even with Alias

1989
2
12-01-2011 02:47 PM
MarthaSelig1
New Contributor II
I keep reading that I can use the field alias in the FeatureSet returned by the queryTask but I can't seem to get it to work. I asked the service owner to give SHAPE.area an alias of SQFT to get around the problem of the dot in the field name. I can see that they did at the REST endpoint and when I run my query there, using * for the outfields, I get the alias and the value.

Not so when I run the query in my Flex app. Still using * for the outfields, I get the value returned OK but wherever I look in the event, the name is still SHAPE.area. The only place I can find SQFT is in the fieldAliases object. It doesn't, unfortunately, include the value as well.

What is the correct way to access SHAPE.area in my application? I need to format it for presentation and I need to convert it to acres as well. I've tried featureSet.attributes.SQFT and I'd found an object yesterday in the event called lastResult (can't find it today), that displayed both the alias pairs and then the name-value pairs, but the name there was still SHAPE.area and I couldn't get at the value. It's as though I am specifying a field that doesn't exist.

I am using agslib-2.4-2011-07-25.swc and am happy to provide any other information deemed useful. The service is on a server running AGS 9.3.1 and it is based on an MSD to get the alias to show up.

Thanks in advance,
Martha
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Martha,

   Have you tried featureSet.attributes["SHAPE.area"]?
0 Kudos
MarthaSelig1
New Contributor II
Pleasure to meet you, Sir. I'm a huge fan.

I'm embarrassed to say I neglected to include the quotes. Wow, I just hate it when the mountains are no problem but the molehills get in the way.

Thanks,
Martha
0 Kudos