New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

reproject-bbox

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reproject-bbox

Reproject a Bounding Box

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1K
increased by0.79%
Maintainers
1
Weekly downloads
 
Created
Source

reproject-bbox

Reproject a Bounding Box

install

npm install reproject-bbox

basic usage


import reprojectBoundingBox from "reproject-bbox";

const bbox = reprojectBoundingBox({
  bbox: [ -122.51, 40.97, -122.34, 41.11 ],
  
  // spatial reference system of input bounding box
  from: 4326,
  
  // convert bounding box to this spatial reference system
  to: 3857
});

// bbox is [-13637750.817083945, 5007917.677222896, -13618826.503649088, 5028580.202823918]

advanced usage

proj4-fully-loaded dependency

This library depends on proj4-fully-loaded. If proj4-fully-loaded isn't found (perhaps because you used null-loader, then reproject-bbox will attempt to look for a valid proj4 at window.proj4.

pluggable

If you don't need any dependencies and would prefer to pass in a reprojection function, you can do so:

import reprojectBoundingBox from "reproject-bbox/pluggable.js";

const bbox = reprojectBoundingBox({
  bbox: [ -122.51, 40.97, -122.34, 41.11 ],
  reproject: proj4("EPSG:4326", "EPSG:3857").forward,
});

// bbox is [-13637750.817083945, 5007917.677222896, -13618826.503649088, 5028580.202823918]

Keywords

FAQs

Package last updated on 06 Nov 2022

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