Skip to contents

Takes a bbox and returns an equivalent Feature<Polygon>

Usage

geo_bbox_polygon(bbox)

Arguments

bbox

extent in [minX, minY, maxX, maxY] order

Value

Feature<Polygon> a Polygon representation of the bounding box

Examples

geo_bbox_polygon(c(0, 0, 10, 10))
#> [1] "{\"geometry\":{\"coordinates\":[[[0.0,0.0],[10.0,0.0],[10.0,10.0],[0.0,10.0],[0.0,0.0]]],\"type\":\"Polygon\"},\"properties\":{},\"type\":\"Feature\"}"
geo_bbox_polygon(c(-90, -30, -70, -10))
#> [1] "{\"geometry\":{\"coordinates\":[[[-90.0,-30.0],[-70.0,-30.0],[-70.0,-10.0],[-90.0,-10.0],[-90.0,-30.0]]],\"type\":\"Polygon\"},\"properties\":{},\"type\":\"Feature\"}"
geo_bbox_polygon(c(0, 0, 10, 10))
#> [1] "{\"geometry\":{\"coordinates\":[[[0.0,0.0],[10.0,0.0],[10.0,10.0],[0.0,10.0],[0.0,0.0]]],\"type\":\"Polygon\"},\"properties\":{},\"type\":\"Feature\"}"