Street view google map URL and coordinate query - google-maps

I am currently converting a number of simple Google Map Street View links into URL requests for static Street View images. Most of the conversions work except for a few odd instances which I am struggling to explain.
Firstly, in the normal way, I access Google Maps as a regular user and find the position on a road in London I want to see called London Wall, and I point upwards and eastwards. This is the resulting link: (please test it and you will see a prominent building called Winchester House with a smooth curved exterior in the flash Street View used by Google consumers):
http://maps.google.com/maps?q=Winchester+House,+London+Wall,+London,+United+Kingdom&hl=en&ll=51.516287,-0.083299&spn=0.007838,0.018196&sll=51.522309,-0.080509&sspn=0.06227,0.145569&oq=winchester+house,+london+wall&hq=Winchester+House,&hnear=Wall,+1+Denbigh+Rd,+London+W11+2SJ,+United+Kingdom&t=m&z=16&layer=c&cbll=51.516305,-0.083422&panoid=U6g4EoZt5cM4e2WFiDLoxA&cbp=12,268.2,,0,-16.66
Secondly, if I adopt the same coordinates from the above link to get a Static Street View Photo via the following URL request, I get a different result:
http://maps.googleapis.com/maps/api/streetview?size=800x600&location=51.516305,%20-0.083422&fov=110&heading=268.2&pitch=16.66&sensor=false
This second view is still looking westwards along London wall, but the Static Street View photo is set approximately 50+ metres on the wrong global coordinate (please try the link above and you will see a footbridge is in front of Winchester House, which lies in the distance).
This is confusing when both URLs above appear to be using the same global coordinates. (I have referenced the same coordinates for many other different links and both URLs usually show the same view).
I would be grateful for anyone's help on this and understand whether anyone has experienced similar problems or inconsistencies with different Google coordinates.
Many thanks
Mike

Related

Google Maps API returns zoomed out repeated view of the globe - possible incorrect coordinates?

I'm working on a project where I am showing 8,000+ lat/long coordinates on a Google Map. Works great.
Today I uploaded another 3,000+, and now the Google Map shows a world view of the globe, repeated horizontally, with a lot of gray space on top.
I've looked through the 3,000+ entries, and do not see any where alpha characters, missing lat/long values, etc - something obvious.
The only thing that I can think of is that a lat/long entry is incorrect, and thus the Google Map zoom breaks? Reviewing questions on SO show hacks such as setting minZoom or zoom levels - but I feel that isn't the right path to go across to solve this, since it was working before and something is happening with my new records. I've checked that no pins are on the map outside USA which may cause the entire world view to show.
I'm reaching out to the community to see if anyone smarter than me has a tip or suggestion to help edge case occurrences like this, and/or if my assumption of a wrong lat/long is breaking the Map?
One of your lat/long is incorrect. Instead of Google Maps API failing and alerting, it just breaks the map. I'd advise you to run your locations to confirm decimals exists per each record.

Google Street View: How to get indoor panoramas as Google does

I'm looking for a way to get exactly the same indoor panoramas for businesses Google is showing in [Google maps] (can't add any more links).
What I did:
google.maps.StreetViewService class requires either lng/lat or pano ID, so...
convert business address to lng/lat using google.maps.Geocoder (issues occured, see below)e.g. Richard-Wagner-Str. 7, 04109 Leipzig, Germany
convert business to lng/lat using google.maps.Place (issues occured, see below)e.g. Park Hotel, Richard-Wagner-Str. 7, 04109 Leipzig, Germany
thanks to this post I found a way to get pano ID for a certain address
Issues:
None of this was working as I hoped for...
get indoor panorama by converting business address to lng/lat:found resulting panorama to be wrong business at same address (got restaurant, wanted hotel) --- and no, there was no resulting array with multiple entries
get indoor panorama by using whole search term with places API:
got slightly different lng/lat but was outside panorama instead of inside
get indoor panorama by pano ID:
working fine but still was outside panorama
Questions:
It must be working. Somehow. Any idea how Google's doing the job? (check with Google maps, review box on the left: using address responds with same outside pano Google shows as well. But how to get corresponding inside pano?)
How to make sure a pano is inside, not outside?
Quite often, Google offers multiple indoor panos for a certain business. Any suggestions how this may work?
documentation of http://developers.google.com/places/place-id#id-overview says, place-id "... can be used with Google Maps Javascript API ..."Any idea why not working with street view panos?
Many thanks!
Update
Making my questions more precise:
How do I get same indoor panoramas as Google does?
How do I get more than just one panorama per business (as Google does)?
Any chance to make street view work with Google Places place_id?
you can use this tool to extract pano ID :)
www.ekreativa.com/pano-id-extract/

API to display the nearest photos to a long/lat location from Google Maps Views (like Panoramio)

Forgive me if this has already been asked but searching on 'Google Maps Views' brings up rather a lot of irrelevant hits.
Is there an API to display the nearest (say) 5 photos to a particular long/lat location from the photos available on Google Maps Views? I don't particularly need them on a map, just to embed thumbnails of the photos and link to the originals.
eg I have a page for Callanish stone circle. Could I embed images from Views based on a long/lat query?
Here's what is on Views for that location:
https://www.google.com/maps/views/explore?hl=en&gl=gb&vm=1&ll=54.596562,-3.104517&bd=54.586641,-3.121855,54.606481,-3.087179&z=15&pv=2
I read that Views is what is supposed to be taking over from Panoramio. I know Panoramio had an API but that's being shut down.
If this is possible, does anyone have an example of something similar? Showing photos on a map would be OK if that's the only way to do it.
Many thanks
Andy
http://www.megalithic.co.uk/article.php?sid=42
The Google Maps API can do it and the imagery carousel at the bottom of Google Maps website is a good example of it.
Nearest photos
You can retrieve the nearest photos to a location using the Places Photo feature, which is part of the Places library. As you want multiple photos, you need to use Place Details requests - function getDetails(). It will return up to ten PlacePhoto objects.
You probably want to submit a small height/width since you create thumbnails. And send another request with a larger height/width when a thumbnail is clicked.
Nearest Street View panorama
If, by chance, a road close to Callanish stone circle has been photographed by Street View, you can add this imagery as well.
Requests for Street View panoramas include a radius parameter. The callback function returns the nearest imagery within the requested radius. See this example. Thereby, you can retrieve one panorama by passing a very large radius.

Automatic Google Street View Heading

Is there an easy way to get Street View to automatically set the heading like the Street View Image API does?
I have Google Street View images embedded in my application and I would like to put a link on them that will direct the user to the full Google Street View, preferably with the same heading. So far I can link to full Street View with the coordinates but not the heading, since I don't know the heading.
For a certain coordinate, the Street Map Image API will give me an image pointed at the coordinates given. For example:
http://maps.googleapis.com/maps/api/streetview?size=300x150&location=38.9506254,-76.942316
Using the an unofficial resource (http://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters) I can create a link to Google Street View, but I must provide a heading angle, which I don't have. Here's an example with the Street View window parameters left off.
http://maps.google.com/maps?q=&layer=c&cbll=38.9506254,-76.942316
This works but does not give me a heading pointing toward the coordinates. Instead, it points due north. I assume I can host my own Street View page and get the heading as a vector from the nearest panorama to the target, as it appears Street View Image API does. I would rather not if I don't have to if I can just embed a single link.
Also, is it safe to use the google map URL parameters? They appear to be undocumented, but I can find references to the parameters I am using back in 2008 so they seem stable.
Edit:
To further elaborate on the difference between full Street View with URL parameters and Street View Image API, here's a diagram of what I get from both without specifying a heading.
Street View Image API will automatically point the POV camera at the target from the nearest Street View panorama when no heading is provided. Full Street View, through URL parameters without heading, will point the POV camera due north. I am looking for a easy way to mimic the Street View Image API behavior with Street View through URL parameters without having to pull panorama location information from google, though that looks like the only option.
If you know the heading that you want you can add a heading parameter in the querystring. Quoting from Google docs:
Heading indicates the compass heading of the camera. Accepted values are from 0 to 360 (both values indicating North, with 90
indicating East, and 180 South). If no heading is specified, a value
will be calculated that directs the camera towards the specified
location, from the point at which the closest photograph was taken.

Link to Google Streetview using Lat/Long

I'm trying to make an app that links to Google streetview using latitude/longitude coordinates, and shows a streetview of the nearest road. This is coming from a fairly small and well covered area, so there isn't going to be any coordinates in the middle of the ocean.
Is there a published API showing the get parameters you need to link directly to streetview?
You may be interested in checking out the following reference, which describes all the known parameters that can be passed to maps.google.com, including Street View parameters:
asnsblues: Google Map Parameters
While this is not an official API, I think it is fair to say that these should be quite reliable, since they are the same parameters used for the permanent links in Google Maps.
With this, you should be able to construct something like the following:
http://maps.google.com/?cbll=40.714103,-74.006206&cbp=12,20.09,,0,5&layer=c
If you want to extract the raw jpegs from the Streetview service this can be done fairly easily. The technique is discussed here:
http://jamiethompson.co.uk/web/2010/05/15/google-streetview-static-api/
XML metadata for a panorama can be gained from the following request
http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG]
which gets you something like this:
<panorama>
<data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" pano_id="sLaiF6Jex7mJmNol7tdOoA" num_zoom_levels="3" lat="51.495090" lng="-0.146971" original_lat="51.495098" original_lng="-0.147000">
<copyright>© 2010 Google</copyright>
<text>Eccleston Pl</text>
<region>London, England</region>
<country>United Kingdom</country>
<data_flag>1</data_flag>
</data_properties>
<projection_properties projection_type="spherical" pano_yaw_deg="201.78" tilt_yaw_deg="92.06" tilt_pitch_deg="1.75"/>
<annotation_properties>
<link yaw_deg="204.7" pano_id="CeutxcyB2V74lfN_fJwRww" road_argb="0x80ffffff">
<link_text>Eccleston Pl</link_text>
</link>
<link yaw_deg="24.7" pano_id="t_mnKSugTLrQTEnJplXQ3A" road_argb="0x80ffffff">
<link_text>Eccleston Pl</link_text>
</link>
</annotation_properties>
The pano_ids can then be used to get thumbnails or high resolution tiles from the streetview API
Thumbnail
http://cbk0.google.com/cbk?output=thumbnail&w=416&h=208&panoid=sLaiF6Jex7mJmNol7tdOoA
Tile
http://cbk0.google.com/cbk?output=tile&panoid=sLaiF6Jex7mJmNol7tdOoA&zoom=4&x=0&y=3
Do you mean something like this?
The following is a link to a streetview picture at coordinates 40.437, -79.962 (lat,lon):
http://maps.google.com/maps?f=q&hl=en&geocode=&sll=40.437965,-79.96253&sspn=0.007104,0.020084&layer=c&ie=UTF8&ll=40.437361,-79.960599&spn=0.007104,0.027122&z=16&cbll=40.433975,-79.962101&cbp=2,142.0851621378081,,0,3.3364732946064946
I'm not sure why the coordinates are repeated a few times, I suspect it might have something to do with viewing direction and the like. I haven't checked whether this works for other coordinates. Hope this helps.