Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@turf/bbox-polygon
Advanced tools
@turf/bbox-polygon is a module from the Turf.js library that allows you to create a Polygon feature from a bounding box (bbox). This is useful for geographic data manipulation and visualization, especially when you need to represent an area defined by a bounding box as a polygon.
Create Polygon from Bounding Box
This feature allows you to create a Polygon feature from a bounding box. The bounding box is defined by an array of four numbers: [minX, minY, maxX, maxY]. The resulting polygon can be used in various geospatial analyses and visualizations.
const turf = require('@turf/bbox-polygon');
const bbox = [0, 0, 10, 10];
const polygon = turf(bbox);
console.log(JSON.stringify(polygon));
The geojson-bbox package provides functionality to calculate the bounding box of a GeoJSON object. While it focuses on calculating the bbox from existing GeoJSON data, it does not create polygons from bboxes like @turf/bbox-polygon.
The bbox package is a lightweight utility for working with bounding boxes. It provides methods to create, manipulate, and query bounding boxes, but it does not offer the capability to convert a bbox directly into a polygon as @turf/bbox-polygon does.
The geojson-utils package offers a variety of utilities for working with GeoJSON data, including calculating bounding boxes and other spatial operations. However, it does not specifically focus on converting bboxes to polygons like @turf/bbox-polygon.
Takes a bbox and returns an equivalent polygon.
Parameters
bbox
BBox extent in [minX, minY, maxX, maxY] orderExamples
var bbox = [0, 0, 10, 10];
var poly = turf.bboxPolygon(bbox);
//addToMap
var addToMap = [poly]
Returns Feature<Polygon> a Polygon representation of the bounding box
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Install this module individually:
$ npm install @turf/bbox-polygon
Or install the Turf module that includes it as a function:
$ npm install @turf/turf
FAQs
turf bbox-polygon module
The npm package @turf/bbox-polygon receives a total of 0 weekly downloads. As such, @turf/bbox-polygon popularity was classified as not popular.
We found that @turf/bbox-polygon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.