[QGIS-Developer] Show Location in Google Earth - Mac / Linux Users Input Requested

C Hamilton adenaculture at gmail.com
Mon Mar 11 13:03:44 PDT 2019


Richard,

Thanks for testing this. I was afraid there might be some OS dependencies
with this. Do you have Google Earth installed on your Debian machine? Is
there a proper way to send a KML to a Linux Google Earth from python?

Calvin

On Mon, Mar 11, 2019 at 2:58 PM Richard Duivenvoorde <rdmailings at duif.net>
wrote:

> On 11/03/2019 15.04, C Hamilton wrote:
> > I've had a request for Lat Lon Tools to support Google Earth with its
> > "Show in External Map" tool. I could create a temporary KML file and
> > make one of the following calls.
> >
> > os.startfile('path to kml file')
> > webbrowser.open('path to kml file')
> >
> > For the Linux and Mac users, do these work and which is preferable? They
> > both work on Windows.
>
> Hi C,
> not sure how to test this but I (Debian) created a simple kml file in
> /tmp/test.kml and then tried your calls:
>
> import os
> os.startfile('/tmp/test.kml')
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/code.py", line 90, in runcode
>     exec(code, self.locals)
>   File "<input>", line 1, in <module>
> AttributeError: module 'os' has no attribute 'startfile'
>
> import webbrowser
> webbrowser.open('/tmp/test.kml')
> True
>
> Opens this test.kml but off course trying to open it in browser
>
> HTH & regards
>
> Richard Duivenvoorde
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190311/0f8d21b7/attachment.html>


More information about the QGIS-Developer mailing list