Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/envelope

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/envelope

turf envelope module

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
590K
decreased by-27.58%
Maintainers
4
Weekly downloads
 
Created

What is @turf/envelope?

@turf/envelope is a module from the Turf.js library that allows you to calculate the bounding box (envelope) of a given GeoJSON feature or set of features. This is useful for determining the minimum bounding rectangle that encloses a set of geographical points, lines, or polygons.

What are @turf/envelope's main functionalities?

Calculate Bounding Box for a Point

This feature allows you to calculate the bounding box for a single point. The code sample creates a point at coordinates [10, 20] and then calculates its bounding box.

const turf = require('@turf/turf');
const point = turf.point([10, 20]);
const envelope = turf.envelope(point);
console.log(envelope);

Calculate Bounding Box for a Polygon

This feature allows you to calculate the bounding box for a polygon. The code sample creates a polygon with specified coordinates and then calculates its bounding box.

const turf = require('@turf/turf');
const polygon = turf.polygon([[
  [10, 20], [30, 40], [50, 60], [10, 20]
]]);
const envelope = turf.envelope(polygon);
console.log(envelope);

Calculate Bounding Box for Multiple Features

This feature allows you to calculate the bounding box for a collection of features. The code sample creates a point and a line, combines them into a feature collection, and then calculates the bounding box for the entire collection.

const turf = require('@turf/turf');
const point = turf.point([10, 20]);
const line = turf.lineString([[30, 40], [50, 60]]);
const featureCollection = turf.featureCollection([point, line]);
const envelope = turf.envelope(featureCollection);
console.log(envelope);

Other packages similar to @turf/envelope

Keywords

FAQs

Package last updated on 30 Apr 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc