Author Topic: Open Google Earth  (Read 7012 times)

0 Members and 1 Guest are viewing this topic.

Jeremy Dunn

  • Newt
  • Posts: 31
Open Google Earth
« on: April 05, 2018, 05:18:39 PM »
I have never interacted with Google Earth through AutoLISP so I hope someone here can help out. I am trying to write a function that will take a latitude and longitude and open up Google Earth to that location. Has someone already done this?

lamarn

  • Swamp Rat
  • Posts: 636
Re: Open Google Earth
« Reply #1 on: April 05, 2018, 05:34:42 PM »
As extra feature for IRT, that would be a killer app!
Design is something you should do with both hands. My 2d hand , my 3d hand ..

NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #2 on: April 06, 2018, 05:22:26 AM »
So let's start here:

Code - Auto/Visual Lisp: [Select]
  1. (if (setq goo (vlax-create-object "GoogleEarth.ApplicationGE"))
  2.  (vl-cmdf "_delay" 3500)
  3.  (vlax-invoke-method goo 'setcameraparams 47.1036 39.4127 0 1 516.064 69.04 30.1109 5)
  4. )
  5.  (alert "Google Earth not found")
  6. )

And take some latitude and longitude, also altitude at some point :-D
Code - Auto/Visual Lisp: [Select]
  1. (setq goo (vlax-create-object "GoogleEarth.ApplicationGE"))
  2. (setq pt (vlax-invoke-method goo 'GetPointOnTerrainFromScreenCoords 47.1036 39.4127))
  3. (setq lon (vlax-get-property pt 'longitude))
  4. (setq lat (vlax-get-property pt 'latitude))
  5. (setq alt (vlax-get-property pt 'altitude))
« Last Edit: April 06, 2018, 05:31:16 AM by NICK_VNV »
Sorry for my English...

Jeremy Dunn

  • Newt
  • Posts: 31
Re: Open Google Earth
« Reply #3 on: April 06, 2018, 10:51:09 AM »
Ok, we're getting closer but I need to know what the 7 numbers in 'setcameraparams mean so that I can set them properly.

kirby

  • Newt
  • Posts: 127
Re: Open Google Earth
« Reply #4 on: April 06, 2018, 01:57:18 PM »
Getting hard to find GE API info...

http://www.adp-gmbh.ch/win/vba/google_earth.html
8 params are:
    latitude of focus point
    longitude of focus point
    altitude of focus point
    altitude mode (unknown)
    Range
    Tilt
    Azimuth
    speed 

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: Open Google Earth
« Reply #5 on: April 06, 2018, 05:46:36 PM »
As extra feature for IRT, that would be a killer app!
by writing IRT i was trying to avoid using GE :)

here's something simillar http://www.theswamp.org/index.php?topic=35739.msg536651#msg536651

57gmc

  • Bull Frog
  • Posts: 358
Re: Open Google Earth
« Reply #6 on: April 06, 2018, 05:55:52 PM »
Getting hard to find GE API info...

Looks like that may be because Google seems to be doing away with the desktop app in favor of a browser-based app. See https://www.google.com/earth/resources/ FAQ at the bottom.

For more info on Earth Engine API see https://developers.google.com/earth-engine/

dgpuertas

  • Newt
  • Posts: 80
Re: Open Google Earth
« Reply #7 on: April 09, 2018, 06:56:28 AM »
I have instaled Google Earth pro but when I put:

_$ (vlax-get-or-create-object "GoogleEarth.ApplicationGE")
nil
_$ (vlax-create-object "GoogleEarth.ApplicationGE")
nil
_$

Anybody knows whats happend in this case???


Thanks and sorry about my english





VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: Open Google Earth
« Reply #8 on: April 09, 2018, 12:07:05 PM »
I have instaled Google Earth pro but when I put:

_$ (vlax-get-or-create-object "GoogleEarth.ApplicationGE")
nil
_$ (vlax-create-object "GoogleEarth.ApplicationGE")
nil
_$

Anybody knows whats happend in this case???
i can't tell you how to solve your problem but in case you can not find the solution, try www.theswamp.org/index.php?topic=47908.0

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Open Google Earth
« Reply #9 on: April 09, 2018, 12:18:17 PM »
I have instaled Google Earth pro but when I put:

_$ (vlax-get-or-create-object "GoogleEarth.ApplicationGE")
nil
_$ (vlax-create-object "GoogleEarth.ApplicationGE")
nil
_$

Anybody knows whats happend in this case???


Thanks and sorry about my english
Maybe this can help: http://www.cruisersforum.com/forums/f121/google-earth-api-gone-144392.html

NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #10 on: April 10, 2018, 03:20:53 AM »
I have instaled Google Earth pro but when I put:

_$ (vlax-get-or-create-object "GoogleEarth.ApplicationGE")
nil
_$ (vlax-create-object "GoogleEarth.ApplicationGE")
nil
_$

Anybody knows whats happend in this case???


Thanks and sorry about my english
It seems GE's COM files not registered in your system. Try to register it manually. Run cmd.exe with admin rights and input two commands with right paths to directories where you installed Google Earth:
Code: [Select]
regsvr32.exe "C:\Program Files\Google\Google Earth\client\earthps.dll"
regsvr32.exe "C:\Program Files\Google\Google Earth\client\googleearth.exe"

p.s.
Also if it fails check this
http://www.nirsoft.net/utils/registered_dll_view.html
download and run regdllview.exe with admin rights and press F6, then register theese two files
« Last Edit: April 10, 2018, 03:50:34 AM by NICK_VNV »
Sorry for my English...

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Open Google Earth
« Reply #11 on: April 10, 2018, 03:51:12 AM »
I have instaled Google Earth pro but when I put:

_$ (vlax-get-or-create-object "GoogleEarth.ApplicationGE")
nil
_$ (vlax-create-object "GoogleEarth.ApplicationGE")
nil
_$

Anybody knows whats happend in this case???


Thanks and sorry about my english
It seems GE's COM files not registered in your system. Try to register it manually. Run cmd.exe with admin rights and input two commands with right paths to directories where you installed Google Earth:
Code: [Select]
regsvr32.exe "C:\Program Files\Google\Google Earth\client\earthps.dll"
regsvr32.exe "C:\Program Files\Google\Google Earth\client\googleearth.exe"
In Pro I do not have earthps.dll  :

Comando: (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\earthps.dll")
nil

Comando: (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe")
"C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"


NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #12 on: April 10, 2018, 04:02:09 AM »
Main thing we need is "googleearth.exe" almost all functions are used from it
Sorry for my English...

NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #13 on: April 10, 2018, 04:06:09 AM »
Try this
Quote
(vlax-import-type-library
  :tlb-filename
  "C:\\Program Files\\Google\\Google Earth\\client\\google~1.exe"
  :methods-prefix
  "vlg-"
  :properties-prefix
  "vlg-"
  :constants-prefix
  "gec-"
)
Then become available:
Code: [Select]
vlg-ClearResults
vlg-Clone
vlg-ConvertToZone
vlg-currentView
vlg-get-Altitude
vlg-get-AnimationController
vlg-get-AutoPilotSpeed
vlg-get-Azimuth
vlg-get-BeginTime
vlg-get-Count
vlg-get-CurrentTimeInterval
vlg-get-currentViewExtents
vlg-get-Cycles
vlg-get-Day
vlg-get-East
vlg-get-ElevationExaggeration
vlg-get-EndTime
vlg-get-FocusPointAltitude
vlg-get-FocusPointAltitudeMode
vlg-get-FocusPointLatitude
vlg-get-FocusPointLongitude
vlg-get-HasView
vlg-get-Highlighted
vlg-get-Hour
vlg-get-Item
vlg-get-Latitude
vlg-get-Longitude
vlg-get-Minute
vlg-get-Month
vlg-get-Name
vlg-get-North
vlg-get-PauseDelay
vlg-get-ProjectedOntoGlobe
vlg-get-Range
vlg-get-SearchController
vlg-get-Second
vlg-get-SliderTimeInterval
vlg-get-South
vlg-get-speed
vlg-get-StreamingProgressPercentage
vlg-get-Tilt
vlg-get-TimeInterval
vlg-get-TimeZone
vlg-get-TourController
vlg-get-Type
vlg-get-VersionAppType
vlg-get-VersionBuild
vlg-get-VersionMajor
vlg-get-VersionMinor
vlg-get-ViewExtents
vlg-get-Visibility
vlg-get-West
vlg-get-Year
vlg-get-ZeroElevationExaggeration
vlg-GetCamera
vlg-GetChildren
vlg-getCurrentVersion
vlg-GetFeatureByHref
vlg-GetFeatureByName
vlg-GetHighlightedFeature
vlg-GetLayersDatabases
vlg-GetMainHwnd
vlg-GetMyPlaces
vlg-GetParent
vlg-GetPointOnTerrainFromScreenCoords
vlg-GetRenderHwnd
vlg-GetResults
vlg-GetTemporaryPlaces
vlg-HideDescriptionBalloons
vlg-Highlight
vlg-isClientInitialized
vlg-IsInitialized
vlg-IsOnline
vlg-IsSearchInProgress
vlg-LoadKml
vlg-LoadKmlData
vlg-Login
vlg-Logout
vlg-OpenFile
vlg-OpenKmlFile
vlg-Pause
vlg-Play
vlg-PlayOrPause
vlg-put-AutoPilotSpeed
vlg-put-Azimuth
vlg-put-CurrentTimeInterval
vlg-put-Cycles
vlg-put-Day
vlg-put-ElevationExaggeration
vlg-put-FocusPointAltitude
vlg-put-FocusPointAltitudeMode
vlg-put-FocusPointLatitude
vlg-put-FocusPointLongitude
vlg-put-Hour
vlg-put-Latitude
vlg-put-Longitude
vlg-put-Minute
vlg-put-Month
vlg-put-PauseDelay
vlg-put-Range
vlg-put-Second
vlg-put-speed
vlg-put-Tilt
vlg-put-TimeZone
vlg-put-Type
vlg-put-Visibility
vlg-put-Year
vlg-QuitApplication
vlg-SaveScreenShot
vlg-Search
vlg-SetCamera
vlg-SetCameraParams
vlg-SetFeatureView
vlg-SetRenderWindowSize
vlg-setView
vlg-setViewParams
vlg-ShowDescriptionBalloon
vlg-Stop
Sorry for my English...

dgpuertas

  • Newt
  • Posts: 80
Re: Open Google Earth
« Reply #14 on: April 10, 2018, 04:50:05 AM »
Thanks a lot, but seems that google earch api is gone in new versions......

Maybe this can help: http://www.cruisersforum.com/forums/f121/google-earth-api-gone-144392.html

Thanks Marco.

NICK_VNV: in that case (as Marco):

Code: [Select]
$ (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\earthps.dll")
nil
_$ (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe")
"C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"


$ (vlax-import-type-library
  :tlb-filename
  "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"
  :methods-prefix
  "vlg-"
  :properties-prefix
  "vlg-"
  :constants-prefix
  "gec-"
)
; error: tipo de argumento erróneo: VLA-OBJECT nil



Maybe uninstall the last version and install older is the solution.

Thanks everybody and sorry about my english.