In this topic
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 hurricane 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 ArcGIS Runtime SDK for Android, 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 to 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);
The TimeAwareLayer interface has a setTimeInterval method that takes a TimeExtent object. TimeExtent acts as a filter for layers that support time, such as ArcGISDynamicMapServiceLayer and ArcGISFeatureLayer layers. 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);