spGplot: Export R information to Google Maps

Description Usage Arguments Value See Also Examples

View source: R/spGplot.R

Description

Export to GoogleMaps R spatial data information

Usage

1
2
3
4
5
6
7
8
spGplot(data, var = NULL, maptype = "satellite", description = list(var =
  NULL, type = NULL, title = NULL), decimals = 3, col.pallete = list(col =
  heat.colors(if (length(cuts) == 1) cuts else length(cuts)), alpha = 1),
  legend.att = list(title = NULL, ncol = 1, bg = "#FFFFFF"), cuts = 5,
  cuts.type = "range", lwd = 1.5, sizeBall = c(0.5, 1), savekml = NULL,
  map.name = "kml", map.description = "description", google.maps = TRUE,
  google.earth.path = try(system("which google-earth", ignore.stdout = T,
  ignore.stderr = T), silent = T), ...)

Arguments

data

a spatial data from any sp classes.

var

an attribute name in the spatial data.

maptype

GoogleMaps types: 'satellite', 'terrain', 'roadmap', 'satellite', 'hybrid'.

description

a list containing the description information in the balloon. var = attribute name(s) in the spatial data. type = type of plot inside the balloon: 'table', 'bar', 'pie' and 'png'. title = balloon title.

decimals

number of decimals in the legend.

col.pallete

a list containing the pallete of colors to be used (col) and the transparency level (alpha) .

legend.att

a list containing the attributes for legend. See legend.

cuts

number of cuts in the legend. Can also be a vector with the cuts point.

cuts.type

method of selecting the cuts points. Ignored if cuts = vector .

lwd

the line width for SpatialLines/SpatialLinesDataframe class.

sizeBall

numeric vector of the length 2 providing the min and max of the balls.

savekml

the name of the output KML. If name is not defined the function will create the file in directory temporary. Default is NULL.

map.name

the name of the KML.

map.description

the description of th KML.

google.maps

boolean. Default TRUE. Define if the data should be exported to GoogleMaps.

google.earth.path

if google.maps = FALSE then GoogleEarth path must be provided

...

further arguments passed to or from other methods.

Value

A plot window on the browser.

See Also

See spRplot.

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
## Not run: 
library(RColorBrewer)
library(spGoogle)
data(rio)

brks <- hist(rio$Dengue, plot = FALSE)$breaks
n_cuts <- length(brks)
pallete <- brewer.pal(n_cuts-1, 'Blues')
names(rio@data)
spGplot(rio, var = "Dengue", cuts = brks, 
        col.pallete = list(col = pallete, alpha = 0.8), 
        description = list(title = 'Name', type = 'table', var = c('Income','Urban')),
        maptype = 'roadmap')
                        
spGplot(rio, var = "Dengue", cuts = brks, 
        col.pallete = list(col = pallete, alpha = 0.8), 
        description = list(title = 'Name', type = 'bar', var = c('Income','Urban')),
        maptype = 'roadmap')
        
spGplot(rio, var = "Dengue", cuts = brks, 
       col.pallete = list(col = pallete, alpha = 0.8), 
       description = list(title = 'Name', type = 'pie', var = c('Income','Urban')),
       maptype = 'roadmap')
       
#custom legend
spGplot(rio, var = "Dengue", cuts = brks, 
       col.pallete = list(col = pallete, alpha = 0.8), 
       description = list(title = 'Name', type = 'pie', var = c('Income','Urban')),
       legend.att = list(title = 'Dengue', bg = 'red', cex = 0.8, ncol = 2)
       maptype = 'roadmap')

## End(Not run)

lgsilvaesilva/spGoogle documentation built on May 21, 2019, 6:08 a.m.