timeslider on an arcgisdynamic layer: only show data from a user set time window?

2122
5
Jump to solution
04-23-2012 11:00 PM
LeenD_hondt
New Contributor III
Dear,

I'm tring to develop a timeslider that only shows data (from an ArcGISDynamiclayer), from a certain interval in time set by the user.
So depending on user-set values, the timeslider should only show data in a certain time window (user-begin to user-end) and not from the begintime to endtime of the full timeslider (which should remain the same, keeping the fullextent).

But how can I set this 'time-window'?
-I do not want to work with featurelayers as in http://help.arcgis.com/en/webapi/flex/samples/index.html#/Filtering_by_time/01nq0000003n000000/ because of the dataload which will become too slow.
-I would need a kind of layerdefinition that does not work on the geographical extent but on the time extent.
I tried via setting the time offset (for the first value):

      
_fLayer=layer as ArcGISDynamicMapServiceLayer;                  fLayer.timeOffset=300;         fLayer.timeOffsetUnits="esriTimeUnitsMinutes";        fLayer.useMapTime=true;

      
But this runs, the slider indeed does not show anything in the first 300 min, but than all points (including points which occured in those 300 first minutes) are shown.
However, I am looking for a way to only have the timeslider playing data (cumulatively) which happened after those 300 minutes (not incl. the points from within those 300 minutes).

Any advise would be great!
Kindly
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Leen,

   Are you sure that you can not use a featureLayer for that one layer and add it to the map only when you need to use the time slider? ESRI adds and remove FeatureLayers dynamically all the time in code like the search widget.

View solution in original post

0 Kudos
5 Replies
LeenD_hondt
New Contributor III
Hi,

I'm trying to use a layerdefinition on a time field (which should work with ArcGIS 10.0). However, for some reason the results of the query are not as required.

My Data: The attribute field named 'creation_time' has the datatype 'DATE'. When viewing in the ArcGIS Services Directory dates look like:

70888A8B
fleetpoc2.fleetpoc2.Tracks.objectid: 1
    fleetpoc2.fleetpoc2.Tracks.gpx: 52050
    fleetpoc2.fleetpoc2.Tracks.elevation: 73
    fleetpoc2.fleetpoc2.Tracks.creation_time: 2012/03/30 03:23:00 UTC

    Point:
    X: 3.16930900000006
    Y: 51.1893850000001

75C79C0E
fleetpoc2.fleetpoc2.Tracks.objectid: 2
    fleetpoc2.fleetpoc2.Tracks.gpx: 52050
    fleetpoc2.fleetpoc2.Tracks.elevation: 51
    fleetpoc2.fleetpoc2.Tracks.creation_time: 2012/03/30 03:24:00 UTC

Etc.


When I run a time query (via the ArcGIS Services Directory): example: WHERE creation_time>=DATE '2012/03/30 7:15:00 PM'
-> all the points are returned (also those earlier than the time '2012/03/30 7:15:00 PM' .
When I run the opposite :WHERE creation_time<DATE '2012/03/30 7:15:00 PM'
-> no results are found

(Performing queries on other fields works perfectly, only for the time field there is an issue).
I tried removing the 'PM' etc. but without success.

Any advice?

Thanks in advance!





Dear,

I'm tring to develop a timeslider that only shows data (from an ArcGISDynamiclayer), from a certain interval in time set by the user.
So depending on user-set values, the timeslider should only show data in a certain time window (user-begin to user-end) and not from the begintime to endtime of the full timeslider (which should remain the same, keeping the fullextent).

But how can I set this 'time-window'?
-I do not want to work with featurelayers as in http://help.arcgis.com/en/webapi/flex/samples/index.html#/Filtering_by_time/01nq0000003n000000/ because of the dataload which will become too slow.
-I would need a kind of layerdefinition that does not work on the geographical extent but on the time extent.
I tried via setting the time offset (for the first value):

      
_fLayer=layer as ArcGISDynamicMapServiceLayer;  
       
       fLayer.timeOffset=300; 
       fLayer.timeOffsetUnits="esriTimeUnitsMinutes";
       fLayer.useMapTime=true;

      
But this runs, the slider indeed does not show anything in the first 300 min, but than all points (including points which occured in those 300 first minutes) are shown.
However, I am looking for a way to only have the timeslider playing data (cumulatively) which happened after those 300 minutes (not incl. the points from within those 300 minutes).

Any advise would be great!
Kindly
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Leen,

   You need to be using the FeatureLayers timeDefinition.

fLayer.timeDefinition = new TimeExtent(DatePicker1.selectedDate,DatePicker2.selectedDate);


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
LeenD_hondt
New Contributor III
Thanks for your answer. The problem is that I need to work with an ArcGISDynacmic layer and not a featurelayer because my data is too heavy (the dataload with featurelayer is too long). But for ArcGISDynamic layer, there is no 'timeDefinition' property.. do you know a way around for the latter?
Thanks again!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Leen,

   Are you sure that you can not use a featureLayer for that one layer and add it to the map only when you need to use the time slider? ESRI adds and remove FeatureLayers dynamically all the time in code like the search widget.
0 Kudos
LeenD_hondt
New Contributor III
Dear Robert,

On my testenvironment it is not an issue, but once it will need to run on more than 10.000 points and then the rendering goes very slow (as features are retrieved from the server, instead of images for the arcgisdynamic layer).

However, I found a way around using the layerdefnition on the timefield but instead of using 'DATE' in the syntax, it should be 'timestamp':
Example: tmpLayer.layerDefinitions=["creation_time > timestamp '2012-03-30 07:30:00']. And doing the same for the maximum time window. This works!

However, thanks again for your help!
Leen



Leen,

   Are you sure that you can not use a featureLayer for that one layer and add it to the map only when you need to use the time slider? ESRI adds and remove FeatureLayers dynamically all the time in code like the search widget.
0 Kudos