simpleobis/simpleobisSAI.R

23 lines
715 B
R

# simpleobisSAI.R
# Simple example for SAI integration
#
# Author: Giancarlo Panichi
###############################################################################
library(robis)
library(ggplot2)
library(rgeos)
sname="Sarda sarda"
usedPolygon="POLYGON((-5.657713322217344 45.88175260533238,38.99072417778265 45.88175260533238,38.99072417778265 29.60135866020714,-5.657713322217344 29.60135866020714,-5.657713322217344 45.88175260533238))"
result="occplot.png"
wktP <-readWKT(usedPolygon)
print(wktP@bbox)
#By scientific name and geometry
y=occurrence(sname, geometry = usedPolygon)
occplot<-map_ggplot(y, color = "#ff3399")+coord_sf(xlim = wktP@bbox[1,], ylim = wktP@bbox[2,])
ggsave(result, plot = occplot)