Learn R Programming

sharpshootR (version 1.5)

site_photos_kml: site_photos_kml

Description

Generates a KML file of site locations with associated site photos and a link to a pedon description report.

Usage

site_photos_kml(data, 
filename='photos.kml', make.image.grid=FALSE, 
file.source = c('local', 'relative')
)

Arguments

data

a dataframe

filename

full file path and name with .kml extension

make.image.grid

logical, include linked site images, default is FALSE

file.source

'local' sources the image files to a specific system path, 'relative' sources the image files to files folder that can be included and referenced within a .kmz file

Value

A KML file of of sites with embedded associated site photos.

Details

This function simplifies writing a kml file of site and/or sites with linked photos.

Examples

Run this code
# NOT RUN {
library(soilDB)
library(sharpshootR)
library(plyr)

### Load data #####
# fetch data from NASIS
f <- fetchNASIS()

# trim down to the essentials:
vars <- c("site_id","pedon_id", "siteiid", "describer","obs_date",
"pedonpurpose","taxpartsize","taxsubgrp", 'x_std', 'y_std')
f1 <- site(f)[ , vars]

# get photo links
e <- get_extended_data_from_NASIS_db()$photo

# join photos to site data
d1 <- join(f1, e, by='siteiid')

# write kml file
site_photos_kml(data = d1, filename = 'C:/Temp/site_photos.kml', 
make.image.grid=TRUE, file.source = 'relative') 
# }

Run the code above in your browser using DataLab