Learn R Programming

GeoLight (version 2.0.0)

trip2kml: Write a file which plots a trip in Google Earth

Description

This function creates a .kml file from light intensity measurements over time that can ve viewed as a trip in Google Earth.

Usage

trip2kml(file, tFirst, tSecond, type, degElevation, col.scheme = "heat.colors", point.alpha = 0.7, cex = 1, line.col = "goldenrod")

Arguments

file
A character expression giving the whole path and the name of the resulting output file including the .kml extension.
tFirst
date and time of sunrise/sunset (e.g. 2008-12-01 08:30)
tSecond
date and time of sunrise/sunset (e.g. 2008-12-01 17:30)
type
either 1 or 2, defining tFirst as sunrise or sunset respectively
degElevation
sun elevation angle in degrees (e.g. -6 for "civil twilight"). Either a single value, a vector with the same length as tFirst.
col.scheme
the color scheme used for the points. Possible color schemes are: rainbow, heat.colors, topo.colors, terrain.colors.
point.alpha
a numerical value indicating the transparency of the point colors on a scale from 0 (transparent) to 1 (opaque).
cex
numerical value for the size of the points.
line.col
An character expression (any of colors or hexadecimal notation), or numeric indicating the color of the line connecting the point locations.

Value

This function returns no data. It creates a .kml file in the in the defined path.

Examples

Run this code

data(hoopoe2)
  hoopoe2$tFirst <- as.POSIXct(hoopoe2$tFirst, tz = "GMT")
  hoopoe2$tSecond <- as.POSIXct(hoopoe2$tSecond, tz = "GMT")
filter <- distanceFilter(hoopoe2,distance=30)
## takes time
## trip2kml("trip.kml", hoopoe2$tFirst[filter], hoopoe2$tSecond[filter], hoopoe2$type[filter],
##		degElevation=-6, col.scheme="heat.colors", cex=0.7,
##		line.col="goldenrod")

Run the code above in your browser using DataLab