file <- '/Users/scottmac2/Downloads/taxon-placemarks-2441176.kml'
# KML type file - using the web method
togeojson(file, method='web', outfilename="kml_web")
# KML type file - using the local method
togeojson(file, method='local', outfilename="kml_local")
# Shp type file - using the web method - input is a zipped shp bundle
file <- '~/github/sac/bison.zip'
togeojson(file, method='web', outfilename="shp_web")
# Shp type file - using the local method - input is the actual .shp file
file <- '~/github/sac/bison/bison-Bison_bison-20130704-120856.shp'
togeojson(file, method='local', outfilename="shp_local")
# Get data and save map data
splist <- c('Accipiter erythronemius', 'Junco hyemalis', 'Aix sponsa')
out <- occurrencelist_many(splist, coordinatestatus = TRUE, maxresults = 50)
dat <- gbifdata(out)
names(dat)[names(dat) %in% c("decimalLatitude","decimalLongitude")]
<- c("latitude","longitude")
dat <- stylegeojson(input=dat, var="taxonName", color=c("#976AAE","#6B944D","#BD5945"),
size=c("small","medium","large"))
write.csv(dat, "~/github/sac/mygeojson/rgbif_data.csv")
file <- "~/github/sac/mygeojson/rgbif_data.csv"
togeojson(file, method = "web", destpath = "~/github/sac/mygeojson/",
outfilename = "rgbif_data")
Run the code above in your browser using DataLab