### 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')