Shapes2GE: Producing 3D regular polygons in Google Earth

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Shapes2GE.R

Description

This function produces 3D regular polygons in Google Earth.

Usage

1
Shapes2GE(center, nesting = 0, goo = "Shapes2GE.kml", nedges = 20, orient = 0, colors = "blue", maxAlt = 10000, radius = 50000)

Arguments

center

An array of geographical position for pies (lines = pies, columns = longitude and latitude in decimal degrees).

nesting

Vector for grouping the shapes into handy folders / subfolders (optional). Must correspond to "center" and the groups should be designated as numbers.

goo

Name of the KML file to that will be saved into the working directory (use getwd() to find it).

nedges

The number of edges, defining the general shape of the polygon (3 -> triangle, 4 -> square, etc).

orient

the rotation factor of the pie-chart (in degrees).

maxAlt

the height (ceiling altitude) of the pies.

radius

The pie radius (in meters).

colors

Vector of colors (will correspond to nesting groups, so define one color per group, and not one color per shape), must be defined as hexadecimal values (as produced by usual R color palettes); leave to "auto" to get rainbow colors.

Value

A KML file is produced in the current working directory.

Author(s)

Nils Arrigo, nils.arrigo@gmail.com 2012 EEB, the University of Arizona, Tucson

See Also

GetEdges, Hist2GE, Pies2GE GetEdges Hist2GE Pies2GE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
######Demo script
#Preparing fake matrix
center = cbind(1:6, 1:6)
nesting = rep(1:3, each = 2)

# data to be displayed
fakedata = cbind(nesting, center)
fakedata

#Producing KML - the easy way
Shapes2GE(center = fakedata[, 2:3], 
	  nesting = 1, 
	  colors = "#0000FFFF",
	  goo = "Shapes2GE_V1.kml", 
	  nedges = 20, 
	  orient = 0, 
	  maxAlt = 1e4, 
	  radius = 5e4)

#Producing KML - the very easy way
Shapes2GE(center = fakedata[, 2:3], 
	  nesting = fakedata[, 1], 
	  colors = "auto", #just define your groups and let it get the colors
	  goo = "Shapes2GE_V1b.kml", 
	  nedges = 20, 
	  orient = 0, 
	  maxAlt = 1e4, 
	  radius = 5e4)

#Producing KML - one param per shape
Shapes2GE(center = fakedata[, 2:3], 
	  nesting = c(1, 1, 2, 3, 3, 3), 
	  colors = c("#0F00FFFF","#00FF00FF","#FF0000FF"), #do it yourself
	  goo = "Shapes2GE_V2.kml", 
	  nedges = c(3, 3, 4, 4, 5, 5), 
	  orient = 0, 
	  maxAlt = 1e4, 
	  radius = 5e4)

R2G2 documentation built on May 29, 2017, 1:41 p.m.