On 8.7.2009, at 12:03, Bruce Mutton wrote:

> Perhaps you have a google earth script example Martin?

This one is for AppleScript and for map data.

There is a trick - you must mimic the human interaction to save the  
image. If by script it will be only grey.

GoogleEarth:

1. change the units to UTM
2. switch off the terrain, and all features which occupy the screen  
and which is possibly to take off.
2. put in the corners of area placemarks the best are white crosses.  
You may go very near - several meters from surface, so you may put  
the cross exactly.
3. change the units to degrees and take a note the coordinates of  
upper left and lower right crosses. Reason is the script doesn't  
recognize the UTM coordinates.
4. modify script according your coordinates - the coordinates of  
start point for row and for column, the step for row and for column  
(don't forget the overlay), the end point fot row and for collumn.  
The altitude of camera 2000 m is quite enough.
5. manually save one image to forder you want to all images will be  
saved. Delete it.
6. start the script.
7. you should receive the full folder of images numbered according  
rows/collumns.

Photoshop (CS3 and more):

1. record the action to crop of first image to remove all rests of  
logos from image.
2. make the dropplet from that action.
3. drag all uncropped images to this dropplet.
4. make a panorama from first row in Brigde application - just to  
change place, no any deformations. No blending!. Save it with  
suitable name.
5. do the same with another rows.
6. open the middle row and row just below it. Change the size of  
camvas of middle row to assumed size of map.
7. move the second row to canvas (it will create new layer and resize  
the second row so it is exactly wide as first one.
8. set the behaviour of second layer to "Difference" and manualy move  
so as the overlay will be as black as possible :). switch the  
behaviour to Normal,
9. Do the same with all rows bellow and with all rows above the  
middle row. You may flat the layers time from time to decrease the  
size of final map and save it after each row added.
10. resize the image unproportionaly so the distance of crosses  
horizontally and vertically is in scale you want.
11. crop the map in crosses.
12. you may add white lines after each km/mile and coordinates too.

Altitude:

as in first case, but with Tterrain on and the script will read the  
altitude of placemark in the middle of screen. You should use the  
same trick with UTM and degrees.

m.s.

Map script for Applescript:

-- coordinates of left upper corner of area (degrees)
property beginning_lat : 41.764341
property beginning_long : 21.321398 (*41.764341 21.321398*)

-- parameters for GoogleEarth
set myAltitude to 2000
set myTilt to 0
set myAzimuth to 0

-- parameters for file names
property N : 0
property M : 0

-- parameters for end of script (degrees)

property mySouth : 41.72
property myEast : 21.4
property long_step : 0.0062
property lat_step : 0.0025

-- GE screenshot
-- by  franz at dimbeck.de
-- modofication by martinsluka at mac.com
-- use at your own risk
--
-- Start Google Earth first and allow to connect to server before  
starting the script, set the Terrain feature of GE off

set myLat to beginning_lat
set myLong to beginning_long

repeat while myLat ≥ mySouth -- last row, where script stops

        set N to N + 1

        repeat while myLong ≤ myEast -- end of row and beginning of next one

                set M to M + 1

                set picfile to "test-" & N & "-" & M -- & ".jpg" -- filename 
for  
screenshot
                -- --                                   the file will be saved 
in the folder last used for saving
                set Overwrite to false -- -whether to overwrite an existing pic.
                activate

                tell application "Google Earth"
                        SetViewInfo {latitude:myLat, longitude:myLong,  
distance:myAltitude, tilt:myTilt, azimuth:myAzimuth}
                        repeat while (GetStreamingProgress) < 100 -- test for 
100%  
received data
                        end repeat
                end tell

-- mimic the human way to save image

                tell application "System Events"
                        if UI elements enabled then -- test if GUI-scriptimg is 
enabled
                                tell process "Google Earth"
                                        set frontmost to true
                                end tell
                                -- call dialog for screenshot
                                keystroke "s" using {command down, option down}
                                delay 1
                                -- set the name of the image file
                                keystroke picfile
                                delay 1
                                -- do it
                                keystroke return

                                if Overwrite then
                                        delay 1
                                        keystroke return
                                end if

                        else -- GUI-scripting is not enabled. Tell user how to 
enable it
                                tell application "System Preferences"
                                        activate
                                        set current pane to pane 
"com.apple.preference.universalaccess"
                                        display dialog "UI element scripting is 
not enabled. Check  
\"Enable access for assistive devices\""
                                end tell
                        end if
                end tell
                set myLong to (myLong + long_step) -- long step - it depends on 
 
size of screen. There  should be  10-15% overlap of images

        end repeat
        set myLong to beginning_long -- return to beginning of row
        set M to 0
        set myLat to (myLat - lat_step) -- lat step there should be 10-15%  
overlap
end repeat





Reply via email to