Query data using a time extent.
This workflow can be used to return records that are between a specified start and end date. For example, records of Canada goose sightings over time could be queried to only show sightings during the winter migration time period.
Run the sample, and a subset of records will be displayed on the map.
- An instance of
ServiceFeatureTableis created by passing a URL to the REST endpoint of a time-enabled service. Time-enabled services will have TimeInfo defined in the service description. This information is specified in ArcMap or ArcGIS Pro prior to publishing the service.
- The feature request mode of the
ServiceFeatureTableis set to
ManualCache, so that the developer can control how and when the feature table is populated with data.
FeatureLayeris created by passing in the instance of the
TimeExtentobject is created by specifying start and end date/time objects.
QueryParmatersobject is created with the
ServiceFeatureTable.PopulateFromServiceis executed by passing in the
- The feature table is populated with data that matches the provided query.
This sample uses Atlantic hurricane data from the year 2000. The data is from the National Hurricane Center (NOAA / National Weather Service).
query, time, time extent
<UserControl x:Class="ArcGIS.UWP.Samples.TimeBasedQuery.TimeBasedQuery" 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" /> </Grid> </UserControl>