Why are some street view images not at an angle?

I am using the Google Street View API to display an address image. Although most of the images are surprisingly accurate, I noticed a few that are at the wrong angle, like the house on the corner where the image is from a side street, not from the front street. When I check Google Maps, the image that appears at the top of the left pane is correct.

Example; Below is an image using the URL parameters from the API instructions ; http://maps.googleapis.com/maps/api/streetview?size=300x200&location=39.408751,-104.917738&sensor=false

enter image description here

Below is an image of the same place that appears in the left pane of Google Maps,

https://cbks0.google.com/cbk?output=thumbnail&cb_client=maps_sv&thumb=2&thumbfov=60&ll=39.408554,-104.917506&yaw=317.7&thumbpegman=1&w=300&h=118

enter image description here

Is there a way to get the โ€œbestโ€ angle using the API?

+7
source share
2 answers

If you know the address and the ROOFTOP geocoding result is available, you can find the nearest place on the road, and then use it to request a street view:

http://www.geocodezip.com/v3_Streetview_lookAtB.html?snaptoroad=5175%20Buena%20Vista%20Boulevard,%20Castle%20Rock,%20CO%2080109,%20USA

(if you donโ€™t know the address, you can cancel the geocoding of the location to get it, as I am here)

working example from this question: Using google street view with marker, how to point POV to marker?

Working violin

snippet of working code:

var geocoder = new google.maps.Geocoder(); var myStreetView = null; var marker = null; function geocodeAddress() { var address = document.getElementById('address').value; geocoder.geocode({ 'address': address }, function(results, status) { //alert (results); if (status == google.maps.GeocoderStatus.OK) { //alert(results[0].geometry.location); myStreetView = new google.maps.StreetViewPanorama(document.getElementById("map_canvas")); myStreetView.setPosition(results[0].geometry.location); google.maps.event.addListenerOnce(myStreetView, 'status_changed', function() { var SVstatus = myStreetView.getStatus() document.getElementById('info').innerHTML = "Street View Status="+SVstatus; var heading = google.maps.geometry.spherical.computeHeading(myStreetView.getLocation().latLng, results[0].geometry.location); myStreetView.setPov({ heading: heading, pitch: 0 }); setTimeout(function() { marker = new google.maps.Marker({ position: results[0].geometry.location, map: myStreetView, title: address }); if (marker && marker.setMap) marker.setMap(myStreetView); }, 500); }); } else { alert("Geocode was not successful for the following reason: " + status); } }); google.maps.event.addDomListener(document.getElementById('geoBtn'), 'click', geocodeAddress); } google.maps.event.addDomListener(window, 'load', geocodeAddress); 
 html, body, #map_canvas { height: 100%; width: 100%; } 
 <script src="http://maps.google.com/maps/api/js?libraries=geometry"></script> <input id="address" type="text" value="5175 Buena Vista Boulevard, Castle Rock, CO 80109, USA" /> <input id="geoBtn" type="button" value="Go" /> <div id="info"></div> <div id="map_canvas"></div> 
+4
source

I noticed this too, Google seems to be using a different algorithm to display this image (in the left pane) on its website, and it is more accurate as in the front shot of the location.

There is no direct way to get this angle with your "Street View API", but you can use the javascript API to calculate this angle and pass it to the Image API.

The question is, how can we know what is in front of the building ?, well, the front is usually where the entrance is from the street. Thus, you can use the DirectionService to get the closest transportation start location, which is usually the road at the entrance to the building using this location, now you can easily calculate the header using geometry geometry methods and pass this to your image API.

+4
source

All Articles