wktview: Visualize geojson from a character string or list

Description Usage Arguments Value See Also Examples

View source: R/wktview.R

Description

Visualize geojson from a character string or list

Usage

1
wktview(x, center = NULL, zoom = 5, fmt = 16)

Arguments

x

Input, a geojson character string or list

center

(numeric) A length two vector of the form: longitude, latitude

zoom

(integer) A number between 1 and 18 (1 zoomed out, 18 zoomed in)

fmt

Format string which indicates the number of digits to display after the decimal point when formatting coordinates. Max: 20

Value

Opens a map with the geojson object(s) using leaflet

See Also

as_featurecollection()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# point
str <- "POINT (-116.4000000000000057 45.2000000000000028)"
wktview(str)

# multipoint
df <- us_cities[1:5,c('long','lat')]
str <- multipoint(df)
wktview(str, center = c(-100,40))
wktview(str, center = c(-100,40), zoom = 3)

# linestring
wktview(linestring(c(100.000, 0.000), c(101.000, 1.000), fmt=2),
  center = c(100, 0))

# polygon
a <- polygon(list(c(100.001, 0.001), c(101.12345, 0.001), c(101.001, 1.001),
  c(100.001, 0.001)))
wktview(a, center = c(100, 0))
wktview(a, center = c(100.5, 0), zoom=9)

## End(Not run)

ropensci/wellknown documentation built on May 19, 2018, 9:21 p.m.