GetCamerasInBox Method
GetCamerasInBox returns all cameras for a given latitude/longitude bounding box.
![A box containing 15 cameras](img\box-example.jpg)
Syntax
GetCamerasInBox2(double dblMinLongitude, double dblMaxLongitude, double dblMinLatitude, double dblMaxLatitude, string strRoadNames, int intOptions, string strPassword)
Parameters
Name | Type | Description |
---|---|---|
dblMinLongitude | double | Left edge of the bounding box. |
dblMaxLongitude | double | Right edge of the bounding box. |
dblMinLatitude | double | Bottom edge of the bounding box. |
dblMaxLatitude | double | Top edge of the bounding box. |
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 the request includes a large number of cameras, the method will time-out after 3 minutes. 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 GetCamerasInBox. 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, can be assigned directly to a DataSet in C#
Fields for each returned camera will include:
Name | Type | Description |
---|---|---|
CameraID | int | Unique camera identifier. |
Latitude | float | Latitude, in decimal degrees.
Note: User interfaces should enable viewing of multiple cameras with identical latitude/longitude values (about 25% of all cameras). |
Longitude | float | Longitude, in decimal degrees. |
Name | string | Human readable camera name. |
RegionID | int | Unique region identifier indicating to which region this camera belongs. |
UpdateFrequency | string | How often, in milliseconds, this camera can provide new image frames (see Automatic Image Refresh). The equivalent frame rate is 1000/UpdateFrequency. |
View | string | The known directions in which this camera can be pointed by the traffic control center operators. A combination of “North” and/or “South” and/or “East” and/or “West” e.g. “North/South”, or empty if viewpoints are not known. The view typically corresponds to physical compass directions but traffic direction takes precedence. For example, when an eastbound road turns temporarily to the north, the camera view will still be “East” even though it may physically be facing north. |
DetectedOutOfService | bool | True if the camera is currently out-of-service, i.e., has been behaving abnormally for at least 2 hours. |
ClosestLane | string | The lane closest to the camera, e.g., “Northbound”, “Eastbound”, “Clockwise”, etc., or empty if the closest lane is not known. |
MarkerPost | string | The marker post (milepost, km marker etc.) at the camera location, or empty if the marker post is not known. |
TMCs | string | Comma delimited list of TMC codes, representing road segments of which this camera may have a view. When more than one TMC code is given, the list is sorted by likelihood that the camera has a view of the segment, most likely first. |
VehicleID | string | Unique anonymous vehicle identifer, if the camera is a hotspot camera
(see Hotspot Cameras for more information).
Note: VehicleID should not be made visible to the end user, including in a web browser's address bar, or by viewing a web page's source. |
Speed | int | Speed of the vehicle, in kph, if the camera is a hotspot camera. |
Heading | int | Heading of the vehicle, in degrees, if the camera is a hotspot camera. |
CollectedTime | string | The date and time at which the image was collected from the vehicle, in Coordinated Universal Time (UTC), if the camera is a hotspot camera. |
Visibility | string | Visibility coniditions for this camera, if available. Possible values are “Low” and “Clear”, where “Low” indicates visibility less than 300m. |
VisibilityConfidence | int | Confidence of the visibility conditions for this camera, if available. Confidence is expressed as a value between 0 and 100, where 100 indicates the highest possible confidence. |
StreamCoding | string |
Video coding format (codec) of the the first video stream for this camera, if available. Example: H264, WMV.
Note: Cameras without streaming capability will not have StreamCoding or StreamContainer fields in the response. |
StreamCoding2 | string | Video coding format (codec) of the the second video stream for this camera, if available. |
StreamCoding3 | string | Video coding format (codec) of the the third video stream for this camera, if available. |
StreamContainer | string |
Container format of the the first video stream for this camera, if available. Example: MP4, ASF, FLV.
Note: A particular format such as MPEG-TS is not guaranteed to appear in the same StreamContainer, StreamContainer2 or StreamContainer3 field. All 3 fields must be examined to locate a particular format. |
StreamContainer2 | string | Container format of the the second video stream for this camera, if available. |
StreamContainer3 | string | Container format of the the third video stream for this camera, if available. |
Width | int | Width, in pixels, of the video stream for this camera, if available. |
Height | int | Height, in pixels, of the video stream for this camera, if available. |
StreamUpdateFrequency | string | How often, in milliseconds, the video stream for this camera must be refreshed. Empty if the video stream doesn't need to be refreshed, or if a video stream isn't available. |
CopyrightNotice | string | Credit for the originating authority, including their main website URL.
Note: The copyright notice must be displayed in full whenever an image is displayed. |
UseWhileDrivingProhibited | bool | Some originating authorities prohibit the viewing of camera images while driving. If set to True, a notice must be displayed stating that viewing of traffic camera images in this region while driving is prohibited, either on entry to the service if the service is designed specifically for use while driving, or on a Terms Of Use page otherwise. |
FeeToEndUserProhibited | bool | Some originating authorities do not permit fees to be charged to the end user for viewing of camera images.
If set to True, end users must not be charged a specific fee to view the image from this camera.
Note: Fees may still be charged to businesses specifically for cameras, or to the general public for a bundle of services that include cameras. |
SublicenseProhibited | bool | Some originating authorities require a license amendment or separate license for each and every sublicensee, to be issued following review of the sublicensee service(s) by the originating authority. If set to True, contact Licensor before displaying the image from this camera to sublicensees. |
HistoricalImagesProhibited | bool | If set to True, the originating authority does not allow historical images to be archived. |
Demonstration | bool | If set to True, the camera is from a pending new region. See intOptions parameter above. |
AdsProhibited | bool | Some originating authorities do not permit advertisements to be directly associated with their cameras. If set to True, web pages and apps may still contain advertisements, provided they are not directly associated with the cameras or camera images. For example, a popup window that displays a camera image may not contain an advertisement. |
Hotspot | bool |
Present and set to True, if the camera is a hotspot camera (see Hotspot Cameras for more information).
Note: Cameras which are not hotspot cameras will not have the Hotspot field in the response. |
TemporaryPassword | string |
A temporary password that can be used to authenticate calls to GetCameraImage for up to 1 hour. See intOptions parameter above.
Note: Consecutive white spaces in a temporary password will appear as a single space if viewed in a web browser. |
Example
Request |
---|
http://www.vizzion.com/TrafficCamsService/TrafficCams.asmx/GetCamerasInBox2?dblMinLongitude=-77.187&dblMaxLongitude=-76.901&dblMinLatitude=38.799&dblMaxLatitude=38.823&strRoadNames=&intOptions=0&strPassword=<password> |
Response |
---|
... <Cameras diffgr:id="Cameras1" msdata:rowOrder="0"> <CameraID>13970</CameraID> <RegionID>339</RegionID> <Name>Backlick Rd / Edsall Rd</Name> <Latitude>38.807</Latitude> <Longitude>-77.185</Longitude> <UpdateFrequency>15000</UpdateFrequency> <DetectedOutOfService>false</DetectedOutOfService> <TMCs>110P11023,110N11023,110-11023</TMCs> <StreamCoding>H264</StreamCoding> <StreamCoding2>H264</StreamCoding2> <StreamCoding3>H264</StreamCoding3> <StreamContainer>FLV</StreamContainer> <StreamContainer2>MPEG-TS</StreamContainer2> <StreamContainer3>RTP</StreamContainer3> <Width>320</Width> <Height>240</Height> <Visibility>Low</Visibility> <VisibilityConfidence>90</VisibilityConfidence> <CopyrightNotice>Image © Virginia DOT www.511virginia.org </CopyrightNotice> <UseWhileDrivingProhibited>false</UseWhileDrivingProhibited> <FeeToEndUserProhibited>false</FeeToEndUserProhibited> <SubLicenseProhibited>false</SubLicenseProhibited> <HistoricalImagesProhibited>false</HistoricalImagesProhibited> <AdsProhibited>false</AdsProhibited> <Demonstration>false</Demonstration> </Cameras> <Cameras diffgr:id="Cameras2" msdata:rowOrder="1"> <CameraID>134006</CameraID> <RegionID>1829</RegionID> <Name>I-495 / East of MD-5 (E)</Name> <Latitude>38.8186</Latitude> <Longitude>-76.9134</Longitude> <View>East</View> <DetectedOutOfService>false</DetectedOutOfService> <TMCs>110-04639</TMCs> <VehicleID>SGZT& ) $#.KTBC612:804;</VehicleID> <Speed>50</Speed> <Heading>90</Heading> <CollectedTime>2019-05-08T15:09:56.0000000Z</CollectedTime> <CopyrightNotice>Image © Vizzion and its providers www.vizzion.com </CopyrightNotice> <UseWhileDrivingProhibited>false</UseWhileDrivingProhibited> <FeeToEndUserProhibited>false</FeeToEndUserProhibited> <SubLicenseProhibited>false</SubLicenseProhibited> <HistoricalImagesProhibited>false</HistoricalImagesProhibited> <AdsProhibited>false</AdsProhibited> <Demonstration>false</Demonstration> <Hotspot>true</Hotspot> </Cameras> ... |