Socket
Socket
Sign inDemoInstall

turf-extent

Package Overview
Dependencies
1
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    turf-extent

turf extent module


Version published
Weekly downloads
8.1K
decreased by-4.58%
Maintainers
8
Created
Weekly downloads
 

Readme

Source

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

parametertypedescription
inputGeoJSONany 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

Keywords

FAQs

Last updated on 06 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc