Select to view content in your preferred language

FeatureSet.ObjectIDs

1263
2
03-19-2011 05:45 AM
TedChapin
Frequent Contributor
In a query completed event, where e is a QueryEventArgs, how can the following be true?

?e.FeatureSet.Count
10
?e.FeatureSet.ObjectIDs.Count
0

Isn't the ObjectIDs property of a FeatureSet an IEnumerable(of Object) representing the Object IDs of the query result?  I'm trying to do a ExecuteRelationshipQueryAsync with a RelationshipParameter that contains all the same Object IDs as the query result, basically get all the records from a related table that correspond to a query result.  Seems like a lot of legwork to manually construct a new IEnumerble(Of Integer) to populate the RelationshipParameter.ObjectIDs.  Why not just RelationshipParameter.ObjectIDs = FeatureSet.ObjectIDs?

Ted Chapin
0 Kudos
2 Replies
TedChapin
Frequent Contributor
I just discovered that if the Query.ReturnIdsOnly property is set to True, then the ObjectIDs property of the FeatureSet of the result is populated, but the features themselves are not.  If this property if False, then you get features but not the ObjectIDs.  Weird.

I manually created a List(of Integer), looped through the FeatureSet and added the object ID's using feature.Attributes("OBJECTID").  Not my favorite approach but it worked.

Ted Chapin
0 Kudos
JenniferNery
Esri Regular Contributor
What you have observed is correct and is documented in REST API: http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/query.html
0 Kudos