Table.query method supposedly has a TimeFilter parameter, but no definition of TimeFilter object is provided in the documentation.
Anyone know how to create a TimeFilter object to supply to Table.query()?
https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#arcgis.features.Table.query
time_filter - a TimeFilter object where either the start timeor start and end time are defined to limit the search results for a given time. The values in the timeFilter should be as UTC timestampes in milliseconds. No checking occurs to see if they are in the right format.
You can pass in a dict with this format:
{'time': '1510704000000,1514764800000'}
Here is an example you can use to construct this dict:
from datetime import datetimeimport time
timerange = [datetime(2017, 11, 15), datetime(2018, 1, 1)]
starttime = int(time.mktime((timerange[0]).timetuple()) * 1000)endtime = int(time.mktime((timerange[1]).timetuple()) * 1000)
time_filter = {'time' : "%s,%s" % (starttime, endtime)}
Thanks, Rohit!
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.