Query data using a time extent.

Use case
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.
How to use the sample
Run the sample, and a subset of records will be displayed on the map.
How it works
- Create a
ServiceFeatureTablefrom a URL 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. - Set the feature table’s
featureRequestModeproperty tomanualCache, so that the developer can control how and when the feature table is populated with data. - Create a
FeatureLayerwith the feature table and add it to a map’s operational layers to display it. - Create a
TimeExtentobject usingDateobjects for the start time and end time being queried. - Create a default
QueryParametersobject and set the parameter’stimeExtentproperty. - Populate the feature table using
ServiceFeatureTable.populateFromService(using:clearCache:outFields:)with the custom query parameters created in the previous steps. - The feature table is populated with data that matches the provided query.
Relevant API
- QueryParameters
- ServiceFeatureTable.populateFromService(using:clearCache:outFields:)
- TimeExtent
About the data
This sample uses Atlantic hurricane data from the year 2000. The data is from the National Hurricane Center (NOAA / National Weather Service).
Tags
query, time, time extent