Time Aware Layers
ArcGIS 10 includes support for time-aware layers, which store information about the changing state of a dataset over time. Time-aware layers allow you to step through periods of time revealing patterns and trends in your data. For example, you can:
- Track hurrincane paths and other meteorological events
- Explore historic patterns in data through time, such as population or land use changes
- Monitor changes in well production or status
- Map the progression of a wildfire or flood
- Visualize the spread of disease over time
In the Android API ArcGIS Dynamic Layers and ArcGIS Feature Layers can be filtered by time and/or date as they implement the TimeAwareLayer Interface.
Working with Dates
When working with time-aware layers you may need to create Java dates to define a time extent or query a layer.
// use Java Calendar date objects
int year = 1970;
Calendar startDate = Calendar.getInstance();
startDate.set(year, Calendar.JANUARY, 1);
Calendar endDate = Calendar.getInstance();
endDate.set(year, Calendar.DECEMBER, 31);
Filtering Data
The TimeAwareLayer interface has a setTimeInterval() method that takes a TimeExtent object which acts as a filter for layers that support time such as the ArcGISDynamicMapServiceLayer and ArcGISFeatureLayer. In this example, only data that meets the input time definition of January 1 through December 1 as shown in the Date example above appears.
// create the time extent with a calendar date
TimeExtent timeExtent = new TimeExtent(startDate, endDate);
// set the time interval on a feature layer
fLayer.setTimeInterval(timeExtent);
// add the feature layer to the map
mMapView.addLayer(fLayer);