I am trying the yahoo traffic api to get the traffic image. It
looks like the query does not return anything if the search area
does not contain any accident.
For example, I can get the traffic by
http://local.yahooapis.com/MapsService/V1/trafficData?appid=YD-
sL3xitQ_JXy0Q47KXwiC8w--
&street=701+First+Street&city=Sunnyvale&state=CA&include_image=1
<ResultSet xsi:schemaLocation="urn:yahoo:maps
http://api.local.yahoo.com/MapsService/V1/TrafficDataResponse.xsd">
<LastUpdateDate>1216777748</LastUpdateDate>
−
<Warning>
The exact location could not be found,
here is the closest match:
701 1st Ave, Sunnyvale, CA 94089
</Warning>
−
<Result type="incident">
<Title>Accident, on LAWRENCE EXPY SB at KIFER RD</Title>
−
<Description>
ACCIDENT; SOUTH OF KIFER RD SEVERAL VEHICLES ON THE SHOULDER .
</Description>
<Latitude>37.374100</Latitude>
<Longitude>-121.996230</Longitude>
<Direction>SB</Direction>
<Severity>2</Severity>
<ReportDate>1216776023</ReportDate>
<UpdateDate>1216776656</UpdateDate>
<EndDate>1216778456</EndDate>
</Result>
−
<Result type="incident">
<Title>Accident, on LAWRENCE EXPY NB at KIFER RD</Title>
−
<Description>
ACCIDENT; SOUTH OF KIFER RD SEVERAL VEHICLES ON THE SHOULDER .
</Description>
<Latitude>37.374100</Latitude>
<Longitude>-121.996110</Longitude>
<Direction>NB</Direction>
<Severity>2</Severity>
<ReportDate>1216776023</ReportDate>
<UpdateDate>1216776656</UpdateDate>
<EndDate>1216778456</EndDate>
</Result>
−
<Result type="incident">
−
<Title>
Slippery road surface, on US-101 NB at SAN ANTONIO RD
</Title>
−
<Description>
ACCIDENT; A SOLO SPINOUT IS BLOCKING THE SECOND LANE FROM THE LEFT
CALIFORNIA HIGHWAY PATROL IS ON THE SCENE; .
</Description>
<Latitude>37.425900</Latitude>
<Longitude>-122.098710</Longitude>
<Direction>NB</Direction>
<Severity>3</Severity>
<ReportDate>1216776073</ReportDate>
<UpdateDate>1216777023</UpdateDate>
<EndDate>1216778457</EndDate>
</Result>
−
<Result type="construction">
<Title>Road construction, on I-880 at GATEWAY BLVD</Title>
<Description>NORTHBOUNDLONGTERM FULL RAMP CLOSURE
CONSTRUCTION</Description>
<Latitude>37.477412</Latitude>
<Longitude>-121.933437</Longitude>
<Direction>N/A</Direction>
<Severity>2</Severity>
<ReportDate>1136610060</ReportDate>
<UpdateDate>1216771740</UpdateDate>
<EndDate>1230792300</EndDate>
</Result>
</ResultSet>
−
<!--
ws05.search.scd.yahoo.com compressed/chunked Tue Jul 22 18:53:07
PDT 2008
-->
But I can not get anything if I set the zoom=1 by
http://local.yahooapis.com/MapsService/V1/trafficData?appid=YD-
sL3xitQ_JXy0Q47KXwiC8w--
&street=701+First+Street&city=Sunnyvale&state=CA&include_image=1&zoom
=1
However, I can query the map if I set the center of the query to the
coordinate of an accident like:
http://local.yahooapis.com/MapsService/V1/trafficData?appid=YD-
YgB5Cag_JXwQtjzRtVFw1g--&street=701+First+Street&longitude=-
122.098&latitude=37.4259&zoom=1&include_map=1
Is it possible to get the traffic map even if there is no accident
in the search area?
Thanks!
-Liang