#' #generate a polygon
library(sp)
polyPoints <- matrix(c(526870,181390,526817,181447,526880,181467,
526885,181447,526909,181425,526870,181390),ncol=2,byrow=TRUE)
demoPolygon <- sp::SpatialPolygons(list(sp::Polygons(list(sp::Polygon(polyPoints)),"1")),
proj4string=sp::CRS("+init=epsg:27700"))
#Create an attribute
integerAttribute <- create_ejAttribute(name="Days since last accident", type="integer",
value=integer(2))
logicalAttribute <- create_ejAttribute(name="Customer satisfied", type="boolean",
value=TRUE)
#create an event
event <- create_ejEvent(id=1, name="A test Event", date=Sys.time(),
location=demoPolygon, attributes=list(integerAttribute, logicalAttribute))
Run the code above in your browser using DataLab