Learn R Programming

lawn (version 0.1.7)

lawn_flip: 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
Feature of features
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

Run this code
# 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)

Run the code above in your browser using DataLab