Last data update: 2014.03.03

R: Calculate envelope around features
lawn_envelopeR Documentation

Calculate envelope around features

Description

Takes any number of features and returns a rectangular data-Polygon that encompasses all vertices.

Usage

lawn_envelope(fc, lint = FALSE)

Arguments

fc

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 rectangular data-Polygon feature that encompasses all vertices

See Also

Other measurements: lawn_along, lawn_area, lawn_bbox_polygon, lawn_bearing, lawn_center, lawn_centroid, lawn_destination, lawn_distance, lawn_extent, lawn_line_distance, lawn_midpoint, lawn_point_on_surface, lawn_size, lawn_square

Examples

fc <- '{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Location A"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-75.343, 39.984]
      }
    }, {
      "type": "Feature",
      "properties": {
        "name": "Location B"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-75.833, 39.284]
      }
    }, {
      "type": "Feature",
      "properties": {
        "name": "Location C"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [-75.534, 39.123]
      }
    }
  ]
}'
lawn_envelope(fc)

Results