# NOT RUN {
showClass("GmlDirectPosition")
showClass("GmlEnvelope")
showClass("GmlFeature")
showClass("GmlFeatureCollection")
showClass("GmlFeatureOrNULL")
showClass("GmlFeatureProperty")
showClass("GmlGeometry")
showClass("GmlLineString")
showClass("GmlPoint")
showClass("GmlPointProperty")
showClass("GmlPolygon")
showClass("GmlTimeGeometricPrimitive")
showClass("GmlTimeInstant")
showClass("GmlTimeInstantOrNULL")
showClass("GmlTimeInstantProperty")
showClass("GmlTimeInstantPropertyOrNULL")
showClass("GmlTimeInterval")
showClass("GmlTimeIntervalOrNULL")
showClass("GmlTimeObject")
showClass("GmlTimeObjectOrNULL")
showClass("GmlTimePeriod")
showClass("GmlTimePosition")
showClass("GmlTimePositionOrNULL")
showClass("GmlTimePrimitive")
# create direct position
pos1 <- GmlDirectPosition(pos = "7.0 52.0")
show(pos1)
# create envelope
env1 <- GmlEnvelope(upperCorner = pos1,
lowerCorner = GmlDirectPosition("6.0 51.0"))
print(env1)
# create envelope with CRS and access it
env1 <- GmlEnvelope(upperCorner = pos1,
lowerCorner = GmlDirectPosition("6.0 51.0"),
srsName = "http://www.opengis.net/def/crs/EPSG/0/4326")
sosGetCRS(env1)
# wrap elements in feature collection
GmlFeatureCollection(id = "001", featureMembers=list(pos1, env1))
# create point with ID
point1 <- GmlPoint(pos = pos1, id = "002")
# create point properties
GmlPointProperty(href = "http://link.to/point")
GmlPointProperty(point = point1)
# time interval of one day
GmlTimeInterval(interval = "1", unit = "d")
# referenced feature
GmlFeatureProperty(href = "http://link.to/feature")
# create a time position and wrap it into a time instant
timePos1 <- GmlTimePosition(time = as.POSIXct("2010-01-01"))
# create direct or referenced time instant
timeInst1 <- GmlTimeInstant(timePosition = timePos1)
timeInst1
GmlTimeInstantProperty(href = "http://link.to/timeInstant")
# create different variants of time periods
# one hour with time positions
GmlTimePeriod(beginPosition = timePos1,
endPosition = GmlTimePosition(time = timePos1@time+3600))
# one week backwards from now
timePos <- GmlTimePosition(time = Sys.time()-(3600*24*7))
aWeekAgo <- GmlTimeInstantProperty(time = GmlTimeInstant(time = timePos))
timePos <- GmlTimePosition(time = Sys.time())
now <- GmlTimeInstantProperty(time = GmlTimeInstant(time = timePos))
GmlTimePeriod(begin = aWeekAgo, end = now)
# }
Run the code above in your browser using DataLab