lawn_flip: Flip x,y to y,x, and vice versa

Description Usage Arguments Value Examples

View source: R/flip.R

Description

Flip x,y to y,x, and vice versa

Usage

1
lawn_flip(input, lint = FALSE)

Arguments

input

data-Feature or data-FeatureCollection

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

Value

A data-Feature or data-FeatureCollection

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# a point
serbia <- '{
  "type": "Feature",
  "properties": {"color": "red"},
  "geometry": {
    "type": "Point",
    "coordinates": [20.566406, 43.421008]
   }
}'
lawn_flip(serbia)

# a featurecollection
pts <- lawn_random("points")
lawn_flip(pts)
## Not run: 
lawn_data$points_average %>% view
lawn_flip(lawn_data$points_average) %>% view
lawn_data$polygons_average %>% view
lawn_flip(lawn_data$polygons_average) %>% view

## End(Not run)

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