Package Exports
- projections
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (projections) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
projections
Collection of map projections. See this Wikipedia list.
Installation
npm install --save projectionsUsage
const projections = require('projections') // for all projections
const miller = require('projections').miller // for a specific projectionWGS to map coordinates
projections.mercator({lon: …, lat: …}, {option: …}) // {x: …, y: …}When given an Object containing lon and lat keys, a projection function returns an object in the form of {x: …, y: …} where 0 ≤ x ≤ 1. For the value range of y, see the map height column in the projections table.
Map coordinates to WGS
projections.mercator({x: …, y: …}, {option: …}) // {lon: …, lat: …}When given an Object containing x and y keys (where 0 ≤ x ≤ 1), a projection function returns an object in the form of {lon: …, lat: …}. Be sure to use the same options everytime you're converting coordinates back and forth to maintain data continuity.
Projections
| Projection | Full name | Available option(s) | Map height |
|---|---|---|---|
braun |
Braun stereographic | latLimit |
|
centralcylindrical |
Central cylindrical | meridian, latLimit |
|
equirectangular |
Equirectangular | meridian, standardParallel |
1 / 2 |
gall |
Gall stereographic | latLimit |
|
gallpeters |
Gall–Peters | - | 2 / π |
kavrayskiy7 |
Kavrayskiy VII | - | |
lambert |
Lambert cylindrical equal-area | meridian |
1 / π |
mercator |
Mercator (Web) | meridian, latLimit |
|
miller |
Miller cylindrical | latLimit |
|
sinusoidal |
Sinusoidal | meridian |
1 / 2 |
Options
| Option | description | Default |
|---|---|---|
meridian |
Latitude of the central meridian | 0 |
latLimit |
maximal latitude in degrees < 90 | 85 |
standardParallel |
latitude of the standard parallel(s) | 0 |
Contributing
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.