::EarthTop, Main

The Earth namespace provides commands to control Google Earth.

CommandsEarth, Top, Main

IsInitialized [::Earth]Earth, Top, Main

Check, if a GoogleEarth instance is initialized.

IsInitialized appId
appIdIdentifier of the GoogleEarth instance.

Returns true or false dependent on the initialization status.

proc ::Earth::IsInitialized {appId} {

    # Check, if a GoogleEarth instance is initialized.
    #
    # appId - Identifier of the GoogleEarth instance.
    #
    # Returns true or false dependent on the initialization status.

    return [$appId IsInitialized]
}

Open [::Earth]Earth, Top, Main

Open a GoogleEarth instance.

Open

Use an already running instance, if available.

Returns the identifier of the GoogleEarth application instance.

See also: OpenNew, Quit

proc ::Earth::Open {} {

    # Open a GoogleEarth instance.
    #
    # Use an already running instance, if available.
    #
    # Returns the identifier of the GoogleEarth application instance.
    #
    # See also: OpenNew Quit

    variable earthAppName

    set appId [Cawt GetOrCreateApp $earthAppName true]
    return $appId
}

OpenNew [::Earth]Earth, Top, Main

Open a new GoogleEarth instance.

OpenNew

Returns the identifier of the new GoogleEarth application instance.

See also: Open, Quit

proc ::Earth::OpenNew {} {

    # Open a new GoogleEarth instance.
    #
    # Returns the identifier of the new GoogleEarth application instance.
    #
    # See also: Open Quit

    variable earthAppName

    set appId [Cawt GetOrCreateApp $earthAppName false]
    return $appId
}

Quit [::Earth]Earth, Top, Main

Quit a GoogleEarth instance.

Quit appId
appIdIdentifier of the GoogleEarth instance.

Returns no value.

See also: Open

proc ::Earth::Quit {appId} {

    # Quit a GoogleEarth instance.
    #
    # appId - Identifier of the GoogleEarth instance.
    #
    # Returns no value.
    #
    # See also: Open

    variable earthProgName

    # Quit method not available, so we kill the application.
    # This may have some strange effects in comination with MediaPlayer.
    # Cawt KillApp $earthProgName
}

SaveImage [::Earth]Earth, Top, Main

Save a grey-scale image of the current view.

SaveImage appId fileName ?quality?
appIdIdentifier of the GoogleEarth instance.
fileNameName of image file.
qualityQuality of the JPEG compression in percent. Optional, default 80.

Returns no value.

proc ::Earth::SaveImage {appId fileName {quality 80}} {

    # Save a grey-scale image of the current view.
    #
    # appId    - Identifier of the GoogleEarth instance.
    # fileName - Name of image file.
    # quality  - Quality of the `JPEG` compression in percent.
    #
    # Returns no value.

    $appId SaveScreenShot [file nativename $fileName] $quality
}

SetCamera [::Earth]Earth, Top, Main

Set camera position and orientation.

SetCamera appId latitude longitude altitude elevation azimuth
appIdIdentifier of the GoogleEarth instance.
latitudeLatitude in degrees. Range [-90.0, 90.0].
longitudeLongitude in degrees. Range [-180.0, 180.0].
altitudeAltitude in meters.
elevationElevation angle in degrees. Range [0.0, 90.0]. 0 degrees corresponds looking to the center of the earth. 90 degrees corresponds looking to the horizon.
azimuthAzimuth angle in degrees. Range [0.0, 360.0]. 0 degrees corresponds looking north. 90 degrees corresponds loooking east.

Returns no value.

proc ::Earth::SetCamera {appId latitude longitude altitude elevation azimuth} {

    # Set camera position and orientation.
    #
    # appId     - Identifier of the GoogleEarth instance.
    # latitude  - Latitude in degrees.  Range \[-90.0, 90.0\].
    # longitude - Longitude in degrees. Range \[-180.0, 180.0\].
    # altitude  - Altitude in meters.
    # elevation - Elevation angle in degrees. Range \[0.0, 90.0\].
    #              0 degrees corresponds looking to the center of the earth.
    #             90 degrees corresponds looking to the horizon.
    # azimuth   - Azimuth angle in degrees. Range \[0.0, 360.0\].
    #              0 degrees corresponds looking north.
    #             90 degrees corresponds loooking east.
    #
    # Returns no value.

    # SetCameraParams <latitude> <longitude> <altitude> <altMode> <range>
    #                 <tilt> <azimuth> <speed>
    #
    # <latitude>  Latitude in degrees.
    # <longitude> Longitude in degrees.
    # <altitude>  Altitude in meters.
    # <altMode>   Altitude mode that defines altitude reference origin.
    #             (1=above ground, 2=absolute)
    # <range>     Distance between focus point and camera in meters.
    #             If !=0 camera will move backward from range meters along the camera axis
    # <tilt>      Tilt angle in degrees.
    # <azimuth>   Azimuth angle in degrees.
    # <speed>     Speed factor. Must be >= 0, if >=5.0 it's the teleportation mode

    $appId SetCameraParams  $latitude $longitude 0.0 1 $altitude  $elevation $azimuth 6.0
}
Document generated by Ruff!