kml_track: Generate KML from locations

Description Usage Arguments Value Author(s) See Also Examples

View source: R/kml_track.R

Description

Function to generate a kml file from tracking data. This is a wrapper of plotKML and kml, specifically designed to generate a kml file from tracking data.

Usage

1
kml_track(sdata, sdata.CRS = "WGS", output = "open", type = "point", ...)

Arguments

sdata

A data frame containing location data of one individual, with the following column headers: "id", "DateTime", "lat", "lon". "id" is an identifier of the individual. "DateTime" is the GMT date & time of each location in class POSIXct or character with the following format "2012-06-03 01:33:46". "lat" and "lon" are the latitude and longitude of each location in decimal degrees.

sdata.CRS

Coordinate reference system (CRS) for the input location data. If the input data is not in WGS, the specific CRS needs to be supplied as a PROJ.4 notation or EPSG code. (e.g. "+proj=utm +zone=37 +datum=WGS84 +units=m +no_defs" or "EPSG:32637")

output

A string specifying whether to 'open' or 'save' the output. The output will be saved in the current working directory.

type

Type of the output. 'point' or 'line.

...

Optional arguments passed to plotKML and kml.

Value

A kml file

Author(s)

Takahiro Shimada

See Also

map_track

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#### Fastloc GPS data obtained from a green turtle
data(turtle)

## Not run: 
#### See the data on Google earth
## points with time stamps
kml_track(turtle, output = 'open', type = 'point', 
points_names = turtle$DateTime, colour_scale = 'yellow')

## lines
kml_track(turtle, output = 'open', type = 'line', colour = 'red')
 

#### Save the location points to the current working directory    
shape <- "http://maps.google.com/mapfiles/kml/pal2/icon26.png"
kml_track(turtle, output = 'save', type = 'point', shape = shape, colour = 'yellow')

## End(Not run)

SDLfilter documentation built on July 20, 2021, 9:07 a.m.