GetCamerasInPolygon Method

GetCamerasInPolygon returns all cameras within a polygon specified by the given latitude/longitude values.

A polygon containing 15 cameras In this example, only the cameras inside the blue polygon will be returned

Syntax

GetCamerasInPolygon2(string strCoordinates, string strRoadNames, int intOptions, string strPassword)

Parameters

Name Type Description
strCoordinates string A list of comma-separated latitude/longitude coordinates of a simple polygon (non-self-intersecting) in parentheses delimited by commas, ordered in the clockwise or counter-clockwise direction. Each coordinate must be unique within the list, and therefore the last coordinate should not be the same as the first.

A self-intersecting polygon A self-intersecting polygon (not permitted)

Coordinates must not be collinear, whereby 3 or more consecutive coordinates lie on a single straight line. 3 coordinates are collinear if:
p1.X * (p2.Y — p3.Y) + p2.X * (p3.Y — p1.Y)
+ p3.X * (p1.Y — p2.Y) = 0 (±0.0000001)

A polygon containing collinear coordinates A polygon with collinear coordinates (not permitted)

The required minimum number of coordinates is 3, and the maximum is 1,000. If intending to use 2 coordinates, see GetCamerasOnRoute.

Note: While the method allows up to 1,000 coordinates, the maximum number that can be listed in a URL query string in a browser is limited.
strRoadNames string List of up to 1,000 road names delimited by the or symbol ( ‘|’ ). This parameter is required, but may be left blank. If one or more road names are supplied, only cameras with names containing one of the supplied road names are returned. If no road names are supplied, all cameras are returned. The method treats certain variations on road names as equivalent, e.g. “Street”, “St”, “St.” are all equivalents, “Highway”, “Hwy”, “Hwy.” are all equivalents, and "I-5", "I5" are equivalents.

Note: While the method allows up to 1,000 road names, the maximum number that can be listed in a URL query string in a browser is limited.
intOptions int A set of bitwise flags OR’ed together:

If intOptions is OR’ed with the value 1, only cameras which have streaming video URLs will be returned. Otherwise cameras which provide still images only and cameras which provide both still images and streaming video URLs are returned.

If intOptions is OR’ed with the value 2, cameras which have the DetectedOutOfService field set to False are guaranteed to be in service for the next 10 minutes. To establish the guarantee, an image is retrieved for every camera inside the bounding box and cached. This can significantly increase the execution time for this method.

If intOptions is OR'ed with the value 4, cameras from pending new regions are included. These pending cameras are for demonstration purposes only and this option must not be used in production systems.

If intOptions is OR'ed with the value 8, a “TemporaryPassword” field will be returned for each camera. The temporary passwords will be good for 1 hour after the time of the call to GetCamerasInPolygon. Unlike the main password, temporary passwords may be exposed to the end user.

If intOptions is OR'ed with the value 16, only cameras which are hotspot cameras will be returned (see Hotspot Cameras for more information). Otherwise both fixed cameras and hotspot cameras will be returned.

If intOptions is OR'ed with the value 32, only cameras which have the DetectedOutOfService field set to False will be returned. Otherwise out-of-service cameras will be included.

If intOptions is OR'ed with the value 64, only cameras which have the Visibility field set to Low will be returned.
strPassword string Unique id/password supplied to you previously.

Return Value

Type: XML

For fields for each returned camera, see GetCamerasInBox.

Example

Request
http://www.vizzion.com/TrafficCamsService/TrafficCams.asmx/GetCamerasInPolygon2?strCoordinates=(47.617535,-122.357006),(47.626705,-122.339582),(47.620833,-122.324026),(47.613934,-122.327867),(47.615337,-122.337866),(47.605876,-122.363229)&strRoadNames=&intOptions=0&strPassword=<password>
Response
For format, see GetCamerasInBox.

Vizzion Confidential and Proprietary