lawn_isolines: Generate Isolines

Description Usage Arguments Details Value See Also Examples

View source: R/isolines.R

Description

Takes data-Point's with z-values and an array of value breaks and generates isolines

Usage

1
2
3
4
5
6
7
8
9
lawn_isolines(
  points,
  breaks,
  z,
  propertiesToAllIsolines = c(),
  propertiesPerIsoline = list(),
  resolution = NULL,
  lint = FALSE
)

Arguments

points

Input points. a point grid, e.g., output of lawn_point_grid()

breaks

(numeric) Where to draw contours.

z

(character) The property name in points from which z-values will be pulled.

propertiesToAllIsolines

GeoJSON properties passed to ALL isolines

propertiesPerIsoline

GeoJSON properties passed, in order, to the correspondent isoline; the breaks array will define the order in which the isolines are created

resolution

(numeric) Resolution of the underlying grid. THIS PARAMETER IS DEFUNCT

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Details

Warning: this function seems to be broken, not sure why

Value

A data-FeatureCollection of isolines (data-LineString features).

See Also

Other interpolation: lawn_hex_grid(), lawn_planepoint(), lawn_point_grid(), lawn_square_grid(), lawn_tin(), lawn_triangle_grid()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# pts <- lawn_random(n = 100, bbox = c(0, 30, 20, 50))
pts <- lawn_point_grid(c(0, 30, 20, 50), 100, 'miles')
pts$features$properties <-
  data.frame(temperature = round(rnorm(NROW(pts$features), mean = 5)),
  stringsAsFactors = FALSE)
breaks <- c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
lawn_isolines(points = pts, breaks, z = 'temperature')

lawn_isolines(pts, breaks, 'temperature') %>% view

## End(Not run)

Example output

<FeatureCollection>
  Bounding box: 0.8 30.6 19.2 49.4
  No. features: 10
  No. points: 770
  Properties: 
   temperature
1            1
2            2
3            3
4            4
5            5
6            6
7            7
8            8
9            9
10          10

lawn documentation built on Jan. 6, 2021, 5:07 p.m.