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

View source: R/flip.R

lawn_flipR Documentation

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

Description

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

Usage

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

# 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)

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.