Find features in a spatial table related to features in a non-spatial table.
The non-spatial tables contained by a map service may contain additional information about sublayer features. Such information can be accessed by traversing table relationships defined in the service.
Once the map image layer loads, a list view will be populated with comment data from non-spatial features. Tap on one of the comments to query related spatial features and display the first result on the map.
- Create an
ArcGISMapImageLayer
with the URL of a map image service. - Load the layer and get one of its tables with
imageLayer.Tables[index]
. - To query the table, create a
QueryParameters
object.You can setqueryParameters.WhereClause
to filter the request features. - Use
table.QueryFeaturesAsync(parameters)
to get aFeatureQueryResult
object. - The
FeatureQueryResult
is an iterable, so simply loop through it to get each resultFeature
. - To query for related features, get the table's relationship info with
table.LayerInfo.RelationshipInfos
. This returns a list ofRelationshipInfo
objects. Choose which one to base your query on. - Now create
RelatedQueryParameters
passing in theRelationshipInfo
. To query related features, usetable.QueryRelatedFeaturesAsync(feature, relatedQueryParameters)
. - This returns a list of
RelatedFeatureQueryResult
objects, each containing a set of related features.
- ArcGISFeature
- ArcGISMapImageLayer
- Feature
- FeatureQueryResult
- QueryParameters
- RelatedFeatureQueryResult
- RelatedQueryParameters
- RelationshipInfo
- ServiceFeatureTable
You can use arcGISMapImageLayer.LoadTablesAndLayersAsync()
to recursively load all sublayers and tables associated with a map image layer.
features, query, related features, search