Recent

Author Topic: Extracting image from GoogleEarth  (Read 756 times)

amir.eng

  • Jr. Member
  • **
  • Posts: 99
Extracting image from GoogleEarth
« on: August 16, 2022, 10:16:29 pm »
Hello everyone,

As you know google forces users to get a api key for using of google map features such as extract elevation, extract images, but I saw some softwares which carry them out without needing to any api key that way they open google earth pro on windows, finally imagery are extracted from it automatically.

Now, I want to know is that possible to do with Lazarus ? (Working directly with GoogleEarth instead of google maps)

For example we give four conrner points as coordinate of a rectangular to program, then it takes out the image from google earth.

Thanks in advance.
« Last Edit: August 16, 2022, 10:44:19 pm by amir.eng »
Lazarus 3.0 , FPC 3.2.2 , Windows 10 64, Excel 2016 64

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Extract image from GoogleEarth
« Reply #1 on: August 16, 2022, 10:37:21 pm »
Fascinating idea. ** I regularly import images /into/ Earth: weather maps and so on downloaded by external scripts. But I can't remember whether there's an export facility, and I don't know whether there's an API (i.e. over a local socket/FIFO/pipe) to trigger that type of action.

My suggestion would be to look at whether any extra sockets etc. are created when Earth starts up, and to research any APIs etc. which were documented before Google bought it up. There's much more in there than most people realise... and I also notice that its reliability is improving, so there must be somebody working on it even though it's been eclipsed by Maps.

Otherwise, as a fallback, I'd suggest researching whether QGIS can do what you want. But to be frank, when I was last looking at this sort of stuff I found Earth's ability to e.g. do a timed reload superior.

MarkMLl

** Edited: I'm assuming that you're talking about Google Earth running as a desktop program, rather than the more recent "Google Earth Engine" which is a "cloud-based" system and to which https://xkcd.com/1481/ applies.
« Last Edit: August 17, 2022, 10:51:07 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jollytall

  • Sr. Member
  • ****
  • Posts: 306
Re: Extracting image from GoogleEarth
« Reply #2 on: August 19, 2022, 11:19:30 am »
I did not use Earth from another program, but many years ago, back in my Windows days, I could get out lots of data from programs without an API, sniffing and manipulating windows messages (using Delphi in those days).
I am not sure, if (a) you can do it with Earth, (b) do you need Administrator privilege to do so and (c) how much of it is done like this nowadays in later Windows releases. The idea would be to do input into "manual" fields just filling in the control through messages from your program and then probably get the image through printscreen and subsequent processing of the captured image.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Extracting image from GoogleEarth
« Reply #3 on: August 19, 2022, 12:12:16 pm »
Hi!

Another solution instead of fetching the data online:

geonames.org offers free data about the whole world.

The main csv file contains 12 million records.
Each records contains

Name/ international name / lat / long /elevation / inhabitants / country / time zone/  and an identification code for mountain peak, city, airport, historical place... and much more

The download server is here:

https://download.geonames.org/export/dump/

The structure is shown in the admincode.txt and features_xx.txt

The main file is allCountries.zip with 359 MB

Even very tiny villages can be found.
And 27 x "San Francisco" all over the world.

Winni

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Extracting image from GoogleEarth
« Reply #4 on: August 19, 2022, 01:21:45 pm »
Prodding Google Earth Pro on Linux a bit: I can see no reference to a --help option or anything equivalent but I do note that the installer allowed it a single parameter which I speculate is a KML or KMZ file.

A bit of brute-force grepping and experimentation suggests

-cachepath
-multiple
-ignoredragdrop
--enableRuntimeProfiling
--oauth_url
--hidegui
--hideminidumpdialog
--fullscreen
-maindb
--disableNetwork
--nightlyServer
-disablemyplaces
--nocrashdetect
-quitonstartup
--auto_switch_to_ogl
-kmlpath
-setDX9
-setDX
-setOGL
-setOGLES20
-dir
--:

There's obviously nothing in that to forcibly save an image, but there might be (undocumented?) commands e.g. embedded in a KML/KMZ relating to its disposition.

Otherwise it's back to looking for some sort of RPC interface etc.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018