
Research
wget to Wipeout: Malicious Go Modules Fetch Destructive Payload
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
@mapbox/geojson-extent
Advanced tools
@mapbox/geojson-extent is an npm package that provides utilities for calculating the bounding box of GeoJSON objects. It is useful for determining the spatial extent of geographic data represented in GeoJSON format.
Calculate Bounding Box
This feature allows you to calculate the bounding box of a GeoJSON object. The bounding box is represented as an array of four numbers: [minX, minY, maxX, maxY].
const geojsonExtent = require('@mapbox/geojson-extent');
const geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [102.0, 0.5]
},
"properties": {
"prop0": "value0"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0],
[103.0, 1.0],
[104.0, 0.0],
[105.0, 1.0]
]
},
"properties": {
"prop0": "value0",
"prop1": 0.0
}
}
]
};
const bbox = geojsonExtent(geojson);
console.log(bbox); // Output: [102, 0, 105, 1]
turf-bbox is a module from the Turf.js library that calculates the bounding box of any GeoJSON object. It offers similar functionality to @mapbox/geojson-extent but is part of a larger suite of geospatial analysis tools provided by Turf.js.
geojson-bbox is a lightweight npm package that calculates the bounding box of GeoJSON objects. It is similar to @mapbox/geojson-extent in terms of functionality but is more focused on simplicity and minimalism.
Compute an extent given a GeoJSON object.
npm install --save @mapbox/geojson-extent
Live example with Mapbox Static Map API
var geojsonExtent = require('geojson-extent');
geojsonExtent({ type: 'Point', coordinates: [0, 0] }); // returns 0,0,0,0 extent
Provides a binary that takes GeoJSON as stdin and returns a JSON stringified array of extent data.
$ npm install -g geojson-extent
$ geojson-extent < file.geojson
Given an argument of leaflet
, this will return Leaflet-formatted data instead.
$ geojson-extent leaflet < file.geojson
extent(geojson)
Given any valid GeoJSON object, return bounds in the form [WSEN]
.
Invalid objects will return null
.
extent.polygon(geojson)
Given any valid GeoJSON object, return bounds in the form of a GeoJSON polygon object.
Invalid objects will return null
.
extent.bboxify(geojson)
Add bounding boxes to all appropriate GeoJSON objects - Feature, FeatureCollection, and Geometry.
FAQs
compute the bounding box of geojson features
The npm package @mapbox/geojson-extent receives a total of 159,113 weekly downloads. As such, @mapbox/geojson-extent popularity was classified as popular.
We found that @mapbox/geojson-extent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 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.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.