Statistical query

This sample demonstrates how to query a feature table to get statistics for a specified field.

Query statistics for features in the map

Instructions

Check the appropriate boxes to filter features by attributes and/or within the current extent. Click the button to see basic statistics displayed for world cities.

Code

<UserControl 
    x:Class="ArcGISRuntime.UWP.Samples.StatisticalQuery.StatisticalQuery"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView"/>
        <Border BorderBrush="Black" BorderThickness="1" Background="White"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <CheckBox x:Name="OnlyInExtentCheckbox"
                          Grid.Row="0" 
                          Content="Cities in current extent"
                          FontWeight="SemiBold" />
                <CheckBox x:Name="OnlyBigCitiesCheckbox"
                          Grid.Row="1"
                          Content="Cities larger than 5M"
                          FontWeight="SemiBold"/>
                <ListBox x:Name="StatResultsListBox"
                         Margin="0,5,0,5"
                         Grid.Row="2"
                         HorizontalAlignment="Stretch"/>
                <Button Content="Get statistics"
                        Grid.Row="3"
                        Margin="0,5,0,0"
                        HorizontalAlignment="Stretch"
                        Click="OnExecuteStatisticsQueryClicked"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code