addGroundOverlay: Add a Ground Overlay to kml

addGroundOverlayR Documentation

Add a Ground Overlay to kml

Description

Add groundoverlay to a kml object. The function uses rgdal package to read positional metadata from the supplied image. If the image has no positional metadata attached then you will need to supply the east and west longitude bounds plus the north and south latitude bounds.

Usage

addGroundOverlay(fn = pathtogeoimage)
addGroundOverlay(fn = pathtosimpleimage, east = maxlon, west = minlon, north = maxlat, south = minlat)

Arguments

fn

Mandatory. Specify the path to the image.

x

Optional dataframe. Allow batch adding of groundoverlays, column names the same as variable names.

east

Define the eastern most edge of the image. Only required if fn has no positional metadata.

west

Define the western most edge of the image. Only required if fn has no positional metadata.

north

Define the northern most edge of the image. Only required if fn has no positional metadata.

west

Define the southern most edge of the image. Only required if fn has no positional metadata.

drawOrder

numeric, set the order of the image rendering. (Default:NULL)

color

Specify a color to blend with the image. This can be one of the predefined colors(), color as hex, or color as rgb object. (Default: NULL)

transparency

numeric. Set the transparency for the color. 0.0 - 1.0, fully opaque:0, solid:1. (Default: 1)

altitude

numeric, meters above/below altiudeMode. 'clamp' altitudeModes ignore altitude. (Default: 0)

altitudeMode

one of "clampToGround", "relativeToGround", "absolute", "clampToSeaFloor", "relativeToSeaFloor". (Default:"clampToGround")

name

Character string or NULL. What the feature will be called in the graphics environment. (Default:NULL)

visibility

Boolean (0-invisible or 1-visible). Specify if these features are visible. (Default: 1)

open

Boolean (0-closed or 1-open). Specify if the feature is open or closed in the kml object tree. (Default: 0)

atomauthor

Character string or NULL. Text identifying an author relevant to the topic. See Ascription Elements under References (Default: NULL)

atomlinkhref

Character string or NULL. Text identifying a web link relevant to the topic. See Ascription Elements under References (Default: NULL)

address

Character string or NULL. Specify an unstructured address that is associated with the overlay. (Default:NULL)

xalAddressDetails

Character string or NULL. Specify an structured address in eXtensible Address Language(sSee xal:AddressDetails under References) that is associated with the overlay. (Default:NULL)

phoneNumber

Character string or NULL. Text identifying a phone number, useful for mobile apps. (Default:NULL)

Snippet

Character string or NULL. Supply details in addition to description. (Default:NULL)

description

Character string or NULL. Supply details, may contain CDATA. See NOTES section for more info. (Default:NULL)

AbstractView

Character string or NULL. The id of the desired AbstractView. Must create AbstractView with addAbstractView() function. (Default:NULL)

TimeStamp

Character string of date-time in one of the following formats: (YYYY)(YYYY-MM)(YYYY-MM-DD)(YYYY-MM-DDThh:mm:ssZ)(YYYY-MM-DDThh:mm:ss). Used to create kml timeseries. (Default:NULL)

TimeSpanStart

Character string of date-time in one of the following formats(overides TimeStamp): (YYYY)(YYYY-MM)(YYYY-MM-DD)(YYYY-MM-DDThh:mm:ssZ)(YYYY-MM-DDThh:mm:ss). Used to create timeseries. (Default:NULL)

TimeSpanEnd

Character string of date-time in one of the following formats(overrides TimeStamp): (YYYY)(YYYY-MM)(YYYY-MM-DD)(YYYY-MM-DDThh:mm:ssZ)(YYYY-MM-DDThh:mm:ss). Used to create timeseries. (Default:NULL)

styleUrl

Character string or NULL. The id of the desired Style. Must create a style with one of the addStyle() or interactiveStyle() functions. (Default:NULL)

Region

Currently not supported

ExtendedData

Currently not supported

inFolder

Allows the adding of data to a specified folder, (EXPERIMENTAL) Usage: inFolder = 'this\that'

Note

description
For advanced description arguments, wrap html in CDATA tags. You can use packages to build html such as R2HTML(uses headers that are not required by CDATA) or, if you are comfortable with html, just add your html text inside CDATA enclosures.
text = ''<!\[CDATA\[
<b><font color="#CC0000" size='+3'>Example Text</font></b>
<br/><br/>
<font face='Courier'>Example Text</font>
]]>''

See also: Description Example

Author(s)

Brent Cameron
Department of Fisheries and Oceans Canada
Population Ecology Division

References

KML groundoverlay Reference
Ascription Elements
xal:AddressDetails

Examples


mykml = RKmlObject()
mykml$addAbstractView(type = "lookat", viewid = "Rview", latitude = 45.5, longitude = -62, range = 1000000)

fn = file.path(R.home(), "doc", "html", "logo.jpg")
mykml$addGroundOverlay(fn = fn, east = -63, west = -61, north = 46.5, south = 44.5, 
  transparency = .3, color = "red", name = "RedR", AbstractView = "Rview" )

#mykml$preview()


brent0/kmlbuilder documentation built on Feb. 2, 2024, 2:05 a.m.