Overlays

Overview

There are three type of overlay that can be used to incorporate images as features in KML. The <GroundOverlay> and <PhotoOverlay> relate to positions on the globe, whilst the <ScreenOverlay> is independent of the area of globe shown in the viewer, but depends on properties of the view space itself.

New KML: <bottomFov> <drawOrder> <east> <gridOrigin> <GroundOverlay> <ImagePyramid> <LatLonBox> <leftFov> <maxHeight> <maxWidth> <near> <north> <overlayXY> <PhotoOverlay> <rightFov> <rotation> <rotationXY> <ScreenOverlay> <screenXY> <shape> <size> <south> <tileSize> <topFov> <ViewVolume> <west>

Tutorial

Ground Overlays

(1) In Google Earth fly to Honolulu, HI and zoom in so land fills the viewer and create a <GroundOverlay> in Google Earth using the following image: honolulu.tif (right-click to download or save URL)
(2) Open the properties dialog box.
(3) Adjust the altitude to 5000m and change the opacity.
(4) Save as hawaii.kml and open in a text editor.
(5) Identify the KML used to define where the overlay is located in Google Earth.
(6) Identify <color> in the KML and change the value to make the overlay fully opaque.

Transparency Slider

The slider at the bottom of the Places sidebar allows you to alter the opacity of a feature. However, this is only the opacity on the viewer (i.e. it is not coded into the KML). Therefore its range is dependent on the KML values, which can be altered through the properties dialog box (i.e. if the KML makes an object totally translucent, the sidebar slider will have no effect).

(7) Adjust the appropriate KML properties so that the image is draped over the topography (set the altitudeMode to clampToGround).
(8) Save changes and view in Google Earth to check they are correct.
(9) Open hawaii.kml in a text editor and within the same document, create a second <GroundOverlay> using oahu.jpg. Save and open in KML.
(10) Google Earth will probably give an error message, edit the KML to fix the problem (Hint: read the error message)
(11) Open the corrected KML in Google Earth and open the properties dialog box for one of the overlays
(12) Under the location tab adjust the draw order to 2.
(13) Turn the overlays on/off and note which is overlain on top when they are both on.
(14) Save as hawaii.kml and view in a text editor.
(15) Identify the KML controlling the order in which overlays are drawn

Web Mapping Service (WMS)

An Open Geospatial Consortium compliant Web Map Service (WMS) produces maps of spatially referenced data dynamically from geographic information. The OGC standard defines a "map" to be a portrayal of geographic information as a digital image file suitable for display on a computer screen, for example, PNG, GIF or JPEG formats (note: the map is not the data itself). WMS data can be linked to a <GroundOverlay> (see Refresh tab in Properties).

Screen Overlays

(16) Open screeno.kml in Google Earth. Note that an image overlay is created in Places. You can control the transparency of this image
(17) Open screeno.kml in a text editor.
(18) Change the overlay XY values to x=1 and y=1. Save and open in Google Earth - What happens?
(19) Try changing the values of x and y in overlayXY and screenXY to values between 0 and 1 (e.g. 0.5) to work out what is happening.
(20) Similarly, change the values for size to x=1 and y=1, and then to values in between 0 and 1 to see how the image size is controlled.
(21) Read the Google's KML documentation on <ScreenOverlay> for more information on the units that can be used to position and size screen overlays. Also note the that can be used to rotate the position of an overlay

Photo Overlays

The element allows you to geographically locate a photograph on the Earth and to specify viewing parameters for this PhotoOverlay. The PhotoOverlay can be a simple 2D rectangle, a partial or full cylinder, or a sphere (for spherical panoramas).

KML 2.2 accommodates very large PhotoOverlays, containing many megapixels of data . These images require the KML author to provide a set of downsampled versions of the image so that Google Earth can efficiently load only the portion of the image that fits into the current view, and at the appropriate level of detail.


Example:

AugiPhoto.kml



For further details see Google's guide to Photo Overlays

Exercise

(A) Create a KML file containing overlays following specifications:

  • ground overlay named Temperatures using AKtemps.jpg
  • screen overlay named Title using TempTitle.jpg positioned top and central
  • screen overlay named Scalebar using TempScale.jpg position bottom and right