Feature Service query with time parameters not working

706
2
Jump to solution
01-02-2019 04:36 PM
DirkVandervoort
Occasional Contributor II

I have a feature service that is fed by Survey123 inspections. I want to post-process the inspections that were collected in the past 24 hours and ignore all the other inspections. According to the documentation (https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) all I need is a time extent. For example "1546384695911,1546471095911" is the time extent for the 24 hours prior to about 0400P MST 1/2/2019.

However the time parameters seem to have no affect on the filtering of returned records. For example, if I use the values from the API documentation (time=1199145600000, 1230768000000 (1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT)), I still get result records, even though I know that there are no records between 1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT.

The documentation is pretty vague about what constitutes "time" and I am wondering what I'm not doing right. Does the feature service need to be time-aware?

Any help or sage bits of wisdom would be much appreciated.

0 Kudos
1 Solution

Accepted Solutions
PeterKnoop
MVP Regular Contributor

It is not well documented in any of the various ArcGIS APIs that support the time parameter for queries. 

You hunch is correct though, the time parameter works only with time-aware layers. Once you make your layer time-aware, then using time parameters with query will filter results based on the field(s) you've specified in defining the time-awareness of layer.

View solution in original post

2 Replies
PeterKnoop
MVP Regular Contributor

It is not well documented in any of the various ArcGIS APIs that support the time parameter for queries. 

You hunch is correct though, the time parameter works only with time-aware layers. Once you make your layer time-aware, then using time parameters with query will filter results based on the field(s) you've specified in defining the time-awareness of layer.

EricThomas2
New Contributor II

This is the exact question I had as well. The records have "CreatedDate" and "EditDate". Does this mean they are "Time aware" or is there something else that needs to be done? 

I'm also getting all results back even though I clearly have time= 1565622608915, 1565633408915 in the query.

0 Kudos