0

Is there a way to open an (embedded or not in QGIS...) window containing a Google Streetview view at given coordinates using PyQGIS?

1

I have a very basic script, but it works just on point layers where the epsg 4326 (lat, lon) coordinates are stored in column as well.

add this script below to your point layer, layer properties-actions (chose type python, and name it):

import webbrowser
new= 2
url= "https://maps.google.com/maps?z=18&q=&layer=c&cbll=[% "lat" %],[% "lon" %]&cbp=11,0,0,0,0"
webbrowser.open(url, new=new)

use the icon called "Run Feature Action" (You can find next to the "Identify Features" icon

  • or check the go2streetview plugin, it may can help – Tamas Kosa May 7 '15 at 14:31
0

I've made a plugin using a lot of the logic from the PinPoint plugin and pulled in the x and y coordinates into this function to open up streetview/bing bird's eye:

import os
def openStreetViewBird(self, x, y):
        link = 'http://data.mapchannels.com/dualmaps5/map.htm?lat=' + y + '&lng=' + x + '&z=18&slat=0&slng=0&sh=0&sp=0&sz=0&panel=mbsi&gm=0&bm=2&mw=1&be=1&mv=1&md=0&mi=1'
        os.startfile(link)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.