Writes object of type SpatialPhotoOverlay to KML together with a COLLADA 3D model file (optional).
kml_layer.SpatialPhotoOverlay(obj, method = c("PhotoOverlay", "monolith")[1],
PhotoOverlay.shape = obj@PhotoOverlay$shape, href = obj@filename,
coords, dae.name = "", heading = obj@PhotoOverlay$heading,
tilt = obj@PhotoOverlay$tilt, roll = obj@PhotoOverlay$roll,
near = obj@PhotoOverlay$near, range = obj@PhotoOverlay$range,
leftFov = obj@PhotoOverlay$leftFov, rightFov = obj@PhotoOverlay$rightFov,
bottomFov = obj@PhotoOverlay$bottomFov, topFov = obj@PhotoOverlay$topFov,
altitudeMode = "clampToGround", block.size = 100, max.depth = 300,
scale.x = 1, scale.y = 1, scale.z = 1, refreshMode = "once",
html.table = NULL, … )
object of class "SpatialPhotoOverlay"
(a photograph with spatial coordinates, metadata and orientation)
visualization type: either "PhotoOverlay"
or "monolith"
PhotoOverlay shape value (KML)
location of the image file
(optional) 3D coordinates of the trapesoid corners
(optional) COLLADA 3D model file name (without the extension)
a PhotoOverlay argument; direction (azimuth) of the camera, in degrees
a PhotoOverlay argument; rotation, in degrees, of the camera around the X axis
a PhotoOverlay argument; rotation, in degrees, of the camera around the Z axis
a PhotoOverlay argument; measurement in meters along the viewing direction from the camera viewpoint to the PhotoOverlay shape
a PhotoOverlay argument; distance in meters from the point specified by <longitude>, <latitude>, and <altitude> to the LookAt position
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the left side of the view volume
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the right side of the view volume
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the bottom side of the view volume
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the top side of the view volume
altitude mode
width of the block (100 m by default)
300 m by default
exaggeration in X dimension (COLLADA rectangle)
exaggeration in Y dimension (COLLADA rectangle)
exaggeration in Z dimension (COLLADA rectangle)
refresh mode for the COLLADA object
(optional) specify the description block (html) for each point
other additional arguments
The default widht and height (100 m and 300 m) were selected based on empirical testing (level of detail in the background imagery in Google Earth). User specified coordinates can be passed via the cords
argument. For more info see makeCOLLADA.rectangle
.
KML Reference (https://developers.google.com/kml/documentation/kmlreference?csw=1)
COLLADA Reference (https://www.khronos.org/collada/)
# NOT RUN {
# display spatially referenced photograph in Google Earth:
imagename = "Soil_monolith.jpg"
x1 <- getWikiMedia.ImageInfo(imagename)
sm <- spPhoto(filename = x1$url$url, exif.info = x1$metadata)
kml_open("sm.kml")
kml_layer(sm, method="monolith")
kml_close("sm.kml")
kml_compress("sm.kml", files="Soil_monolith_jpg.dae")
# }
Run the code above in your browser using DataLab