Learn R Programming

plotKML (version 0.2-4)

kml_layer.SpatialPhotoOverlay: Exports objects of type SpatialPhotoOverlay to KML

Description

Writes object of type SpatialPhotoOverlay to KML together with a COLLADA 3D model file (optional).

Usage

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, ...)

Arguments

obj
object of class "SpatialPhotoOverlay" (a photograph with spatial coordinates, metadata and orientation)
method
visualization type: either "PhotoOverlay" or "monolith"
PhotoOverlay.shape
PhotoOverlay shape value (KML)
href
location of the image file
coords
(optional) 3D coordinates of the trapesoid corners
dae.name
(optional) COLLADA 3D model file name (without the extension)
heading
a PhotoOverlay argument; direction (azimuth) of the camera, in degrees
tilt
a PhotoOverlay argument; rotation, in degrees, of the camera around the X axis
roll
a PhotoOverlay argument; rotation, in degrees, of the camera around the Z axis
near
a PhotoOverlay argument; measurement in meters along the viewing direction from the camera viewpoint to the PhotoOverlay shape
range
a PhotoOverlay argument; distance in meters from the point specified by , , and to the LookAt position
leftFov
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the left side of the view volume
rightFov
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the right side of the view volume
bottomFov
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the bottom side of the view volume
topFov
a PhotoOverlay argument; angle, in degrees, between the camera's viewing direction and the top side of the view volume
altitudeMode
altitude mode
block.size
width of the block (100 m by default)
max.depth
300 m by default
scale.x
exaggeration in X dimension (COLLADA rectangle)
scale.y
exaggeration in Y dimension (COLLADA rectangle)
scale.z
exaggeration in Z dimension (COLLADA rectangle)
refreshMode
refresh mode for the COLLADA object
html.table
(optional) specify the description block (html) for each point
...
other additional arguments

Details

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.

References

  • KML Reference (http://code.google.com/apis/kml/documentation/kmlreference.html)
  • COLLADA Reference (http://collada.org/mediawiki/)

See Also

spPhoto, getWikiMedia.ImageInfo

Examples

Run this code
# 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