Select to view content in your preferred language

Querying a REST service with the Time parameter

217
2
Jump to solution
3 weeks ago
Labels (1)
GrantSmith122
Regular Contributor

Hello, I need some help properly writing a query for a time-enabled REST service. I have a public layer on our REST Endpoint that has been time-enabled. When I go to query the data, however, it seems like my time input has no effect on the query. For example, if I input a point location geometry and a time value that is outside the start_date and end_date values (and use timeRelation=esriTimeRelationOverlaps), I still get a result. It seems like no matter what value I input for the Time: parameter, I still get a result. I am aware of this article, but it does not appear that any of the input formats in that article change my result. Is there any other documentation on Time queries that I should be using?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
f92k
by
Occasional Contributor

See documentation for example for `time` parameter syntax.

Copied here for your convenience.

The time instant or the time extent to query.

Time instant

Syntax: time=<timeInstant>

Example: time=1199145600000 (1 Jan 2008 00:00:00 GMT)

Time extent

Syntax: time=<startTime>, <endTime>

Example: time=1199145600000, 1230768000000 (1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT)

A null value specified for start time or end time will represent infinity for start or end time, respectively. Example: time=null, 1230768000000

Example query outside of the data's time range (expect 0 records as of this post): https://gis.colorado.gov/public/rest/services/OEDIT/Enterprise_Zones/MapServer/2/query?where=1%3D1&t...

Example query inside the data's time range (expect 19 records as of this post): https://gis.colorado.gov/public/rest/services/OEDIT/Enterprise_Zones/MapServer/2/query?where=1%3D1&t...

View solution in original post

0 Kudos
2 Replies
f92k
by
Occasional Contributor

See documentation for example for `time` parameter syntax.

Copied here for your convenience.

The time instant or the time extent to query.

Time instant

Syntax: time=<timeInstant>

Example: time=1199145600000 (1 Jan 2008 00:00:00 GMT)

Time extent

Syntax: time=<startTime>, <endTime>

Example: time=1199145600000, 1230768000000 (1 Jan 2008 00:00:00 GMT to 1 Jan 2009 00:00:00 GMT)

A null value specified for start time or end time will represent infinity for start or end time, respectively. Example: time=null, 1230768000000

Example query outside of the data's time range (expect 0 records as of this post): https://gis.colorado.gov/public/rest/services/OEDIT/Enterprise_Zones/MapServer/2/query?where=1%3D1&t...

Example query inside the data's time range (expect 19 records as of this post): https://gis.colorado.gov/public/rest/services/OEDIT/Enterprise_Zones/MapServer/2/query?where=1%3D1&t...

0 Kudos
GrantSmith122
Regular Contributor

Ah, okay so the time must be in epoch time. Appreciate the help!

0 Kudos