turf-extent
turf extent module
Last updated 6 years ago by morganherlocker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-extent 
SYNC missed versions from official npm registry.

turf-extent

build status

turf extent module

turf.extent(input)

Takes any GeoJSON object, calculates the extent of all input features, and returns a bounding box.

Parameters

parameter type description
input GeoJSON any valid GeoJSON Object

Example

var input = turf.featurecollection([
 turf.point([114.175329, 22.2524]),
 turf.point([114.170007, 22.267969]),
 turf.point([114.200649, 22.274641]),
 turf.point([114.186744, 22.265745])
]);

var bbox = turf.extent(input);

var bboxPolygon = turf.bboxPolygon(bbox);
bboxPolygon.properties.fill = '#00f';

var result = turf.featurecollection(
 input.features.concat(bboxPolygon));

//=result

Installation

Requires nodejs.

$ npm install turf-extent

Tests

$ npm test

Current Tags

  • 1.0.4                                ...           latest (6 years ago)

8 Versions

  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           7 years ago

Copyright 2014 - 2017 © taobao.org |