Select to view content in your preferred language

how to calculate export map time (timeinstant)

2149
4
12-22-2010 09:35 AM
JimHenry
Emerging Contributor
I have a time slider and a dynamic map layer with time enabled.

I am trying to export a still image ... the only method I found is to call the web service sending the parameters. 
http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/export.html

Problem is I can not seem to figure out how to convert/get the timeinstant value from the time slider.
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
If you set the TimeExtent property of your map, the request to the rest end point will be made by the framework behind the scene. That's the easier way.

If for any reason you need to request yourself the rest end point. the timeinstant is the number of milliseconds since 1970 January, the 1st.

So to convert a time to timeinstant, you can use code like:
TimeSpan elapsed = timeToConvert.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);long timeinstant = elapsed.TotalMilliseconds;
0 Kudos
JimHenry
Emerging Contributor
Thanks for the reply!

Do you know of another way (esri control) that I can automate an export (snap shot) of what is displayed on the webmap?  I would like to avoid meshing the images together on the back end in order to create the same image.
0 Kudos
JimHenry
Emerging Contributor
This is sort of what I am looking to do:
http://resources.arcgis.com/gallery/file/net-web-adf/details?entryID=5EC9123A-1422-2418-A090-7B52916...

Since I only want a png/bmp/gif/ect I was hoping for a simpler method
0 Kudos
JimHenry
Emerging Contributor
I found this thread:
http://forums.esri.com/Thread.asp?c=158&f=2455&t=281577

Gave an example of a service that saved out an image using ImageTools (http://imagetools.codeplex.com).
http://acequia.ccrfcd.org/fvadvanced/fvadvanced.aspx

Since I would prefer not to rely on third party tools I am thinking about using the ExportToMap for each layer then combining on the back end with another process using imagemagic or something similar.
0 Kudos