Socket
Socket
Sign inDemoInstall

@mapbox/geojson-extent

Package Overview
Dependencies
6
Maintainers
14
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/geojson-extent

compute the bounding box of geojson features


Version published
Maintainers
14
Weekly downloads
228,635
decreased by-4.83%

Weekly downloads

Readme

Source

geojson-extent

Compute an extent given a GeoJSON object.

install

npm install --save @mapbox/geojson-extent

example

Live example with Mapbox Static Map API

var geojsonExtent = require('geojson-extent');

geojsonExtent({ type: 'Point', coordinates: [0, 0] }); // returns 0,0,0,0 extent

bin

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

api

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.

Keywords

FAQs

Last updated on 14 Sep 2021

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