GetHistoricalCameraImage Method

GetHistoricalCameraImage returns an image, viewpoint (if available), and collection time for a given camera, at or near the given date/time.

Syntax

GetHistoricalCameraImage2(int intCameraID, int intYear, int intMonth, int intDay, int intHour, int intMinute, int intSeekDirection, int intDesiredWidth, int intDesiredHeight, int intDesiredDepth, int intOptions, string strPassword)

Parameters

Name Type Description
intCameraID int Unique camera identifier, as returned by other API methods such as GetCamerasInBox.
intYear int The year, in Coordinated Universal Time (UTC).
intMonth int The month (a value from 1 to 12), in UTC.
intDay int The day of the month (a value from 1 to 31, depending on the month), in UTC.
intHour int The hour (a value from 0 to 23), in UTC.
intMinute int The minutes (a value from 0 to 59), in UTC.
intSeekDirection int The search direction for the historical image (a value of -1, 0, or 1):

A search direction of -1 will return the nearest available image, either at or up to 180 minutes before the specified time and date.

A search direction of 0 will return the nearest available image, either before, at, or after the specified time and date, within 180 minutes in either direction.

A search direction of 1 will return the nearest available image, either at or up to 180 minutes after the specified time and date.
intDesiredWidth int The desired width of the returned image. The image will be subsampled (or supersampled) to match the desired width/height in pixels. The aspect ratio of the original image data is always preserved. When necessary, the returned image will be padded with black pixels. Width must be between 32 and 4096 pixels, inclusive.
intDesiredHeight int The desired height of the returned image. The recommended ratio of desired width to desired height is 3 to 2, e.g., 300x200. Height must be between 32 and 4096 pixels, inclusive.

Note: Applications should not modify the aspect ratio of the original data (e.g., by requesting a 300x200 image and displaying it in a 300x240 viewport).
intDesiredDepth int The desired bit depth of the returned image. Currently only depth 8 is supported.
intOptions int A set of bitwise flags OR’ed together:

If intOptions is OR’ed with the value 1, the camera's entire field of view will be returned, otherwise only the most relevant parts of the camera's field of view will be returned.

If intOptions is OR’ed with the value 2, the image dynamic range will be enhanced for better viewability.

If intOptions is OR’ed with the value 4, dynamic image checks are not performed and any available image will be returned. By default, dynamic checks are made on the camera image for out-of-service or poor quality images. Errors will be returned in place of images that fail the checks.

If intOptions is OR’ed with the value 8, the nearest available daytime image will be returned.
strPassword string Unique id/password supplied to you previously.

Return Value

Type: MIME text/xml (asmx) or MIME/jpeg (ashx)

For fields for each returned camera, see GetCameraImage.

Note: the "Collected" time will be the date and time at which the image was collected, in UTC.

Example 1

Find image searching forward from Sept 5, 2018 @ 10:00 (.ashx)

Request
http://vizzion.com/TrafficCamsService/TrafficCams.ashx?strRequest=GetHistoricalCameraImage2&intCameraID=85&intYear=2018&intMonth=9&intDay=5&intHour=10&intMinute=0&intSeekDirection=1&intDesiredWidth=320&intDesiredHeight=240&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
Historical image example 1
HTTP Header
View: South
Collected: 2018-09-05T10:01:00.0000000Z

Find image searching forward from Sept 5, 2018 @ 10:00 (.asmx)

Request
http://vizzion.com/TrafficCamsService/TrafficCams.asmx/GetHistoricalCameraImage2?intCameraID=85&intYear=2018&intMonth=9&intDay=5&intHour=10&intMinute=0&intSeekDirection=1&intDesiredWidth=320&intDesiredHeight=240&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
...
<Image>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAs...</Image>
<View>South</View>
<Collected>2018-09-05T10:01:00.0000000Z</Collected>
...

Example 2

Find image searching backward from Nov 6, 2018 @ 18:15

Request
http://vizzion.com/TrafficCamsService/TrafficCams.ashx?strRequest=GetHistoricalCameraImage2&intCameraID=12283&intYear=2018&intMonth=11&intDay=6&intHour=18&intMinute=15&intSeekDirection=-1&intDesiredWidth=320&intDesiredHeight=240&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
Historical image example 2
HTTP Header
View: North
Collected: 2018-11-06T18:07:00.0000000Z

Example 3

Find image nearest (in either direction) to Oct 15, 2018 @ 17:45

Request
http://vizzion.com/TrafficCamsService/TrafficCams.ashx?strRequest=GetHistoricalCameraImage2&intCameraID=9912&intYear=2018&intMonth=10&intDay=15&intHour=17&intMinute=45&intSeekDirection=0&intDesiredWidth=320&intDesiredHeight=240&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
Historical image example 3
HTTP Header
View: East
Collected: 2018-10-15T17:48:00.0000000Z

Remarks

Not all cameras support historical imagery — contact your Vizzion Account Manager for a list of available regions.

Vizzion Confidential and Proprietary