to_kmz | R Documentation |
Function to generate a kmz file from tracking data.
This is a wrapper of kml
,
specifically designed to generate a kmz file from tracking data.
to_kmz(sdata, crs = 4326, file.name = "id", ...)
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 |
crs |
A number specifying the European Petroleum Survey Group (EPSG) code for the input location data. |
file.name |
A character specifying the output file name. |
... |
Optional arguments passed to |
A kmz file
Takahiro Shimada
map_track
## Tracking data of two green turtles
data(turtle); data(turtle2)
## Filter data
d1 <- ddfilter(dupfilter(turtle))
d2 <- ddfilter(dupfilter(turtle2))
## Combine two data
d <- list(d1, d2)
## Not run:
## Generate a kmz file from each tracking data
shp <- 'http://maps.google.com/mapfiles/kml/pal2/icon18.png'
for(i in 1:2){
# labels for points (date and time)
pn <- d[[i]]$DateTime
# Apply a colour gradient to points based on the date and time
pt_col <- hcl.colors(n = nrow(d[[i]]), palette = 'Zissou 1')
# Generate a kmz file
to_kmz(d[[i]], shape = shp, colour_scale = pt_col, colour = pn, points_names = pn, LabelScale = 0)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.