All Projects → mbloch → mapshaper-proj

mbloch / mapshaper-proj

Licence: other
A JavaScript port of the Proj.4 map projection library.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to mapshaper-proj

PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+168.97%)
Mutual labels:  projection, epsg
geofiddle
Geometric conversions between different formats and projections
Stars: ✭ 15 (-48.28%)
Mutual labels:  epsg
stylegan2-landmark-projection
Experimental repository attempting to project facial landmarks into the StyleGAN2 latent space.
Stars: ✭ 14 (-51.72%)
Mutual labels:  projection
KJCategories
Collection of native ios extensions and classes to boost development process. Such as UIKit, Foundation, QuartzCore, Accelerate, OpenCV, CoreGraphics, os and more. 超实用开发加速工具收集
Stars: ✭ 423 (+1358.62%)
Mutual labels:  projection
latent space adventures
Buckle up, adventure in the styleGAN2-ada-pytorch network latent space awaits
Stars: ✭ 59 (+103.45%)
Mutual labels:  projection
Papart-examples
Papart examples
Stars: ✭ 29 (+0%)
Mutual labels:  projection
laravel-quasar
⏰📊✨Laravel Time Series - Provides an API to create and maintain data projections (statistics, aggregates, etc.) from your Eloquent models, and convert them to time series.
Stars: ✭ 78 (+168.97%)
Mutual labels:  projection
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+389.66%)
Mutual labels:  projection
isometric
A lightweight JavaScript library, written in TypeScript to create isometric projections using SVGs
Stars: ✭ 53 (+82.76%)
Mutual labels:  projection
pmod
Native cross platform library with language projection support for native code.
Stars: ✭ 22 (-24.14%)
Mutual labels:  projection
pypoman
Python module for polyhedral geometry
Stars: ✭ 26 (-10.34%)
Mutual labels:  projection
GraphQL.RepoDB
A set of extensions for working with HotChocolate GraphQL and Database access with micro-orms such as RepoDb (or Dapper). This extension pack provides access to key elements such as Selections/Projections, Sort arguments, & Paging arguments in a significantly simplified facade so this logic can be leveraged in the Serivces/Repositories that enca…
Stars: ✭ 25 (-13.79%)
Mutual labels:  projection
adaptive-composite-map-projections
Adaptive composite map projections combine several projections
Stars: ✭ 64 (+120.69%)
Mutual labels:  projection
Tools Merge Image PointCloud
Project the PointCloud to the image & Generate the LiDAR PointCloud with color.
Stars: ✭ 39 (+34.48%)
Mutual labels:  projection
cft
Climate futures toolbox: easy MACA (MACAv2) climate data access 📦
Stars: ✭ 16 (-44.83%)
Mutual labels:  projection
mgrs
🌐 An R Package to Convert 'MGRS' (Military Grid Reference System) References From/To Other Coordiante Systems
Stars: ✭ 20 (-31.03%)
Mutual labels:  projection
erkir
Երկիր (Erkir) - a C++ library for geodesic and trigonometric calculations
Stars: ✭ 26 (-10.34%)
Mutual labels:  datum
proj
Go's version of the PROJ.4 projection library
Stars: ✭ 70 (+141.38%)
Mutual labels:  proj4

mapshaper-proj

This software is a JavaScript port of v4.9.3 of the Proj.4 map projection library. Although it was created to be used by mapshaper, all are welcome to use and improve it.

Why create another Proj.4 port, when there is already proj4js? Unlike proj4js, this port is a very literal translation to JavaScript, so staying up-to-date with future changes to Proj.4 should be relatively simple. Also, this software's output is more consistent with Proj.4's output.

Missing features
  • No support for datum transformations using grid files.

  • About 1/5 of Proj.4's 130-odd projections have not been ported.

Command line programs: mproj and mcs2cs

These are workalike versions of the proj and cs2cs programs from Proj.4.

To install the current versions system-wide, run npm install -g mproj.

Node API

The software can be used in either the Proj.4 style or the proj4js style.

proj4js style
var proj = require('mproj');
# create functions for translating between two coordinate systems
# returned object has forward() and inverse() functions
var obj = proj(<source definition>, <dest definition>);

# WGS84 is assumed if a source definition is not given
var obj = proj(<dest definition>);

# a shortcut for translating a single point
# <point> is an [x, y] array or an object with x and y properties
var xy = proj([<source definition>,] dest definition, <point>);

See the proj4js.org website for more detailed help.

Proj.4 style
var proj = require('mproj');
# create a projection object from a proj4 string
var P = proj.pj_init(<proj4 crs definition>);

# project and inverse-project geographical coordinates
var xy = proj.pj_fwd({lam: <longitude in radians>, phi: <latitude in radians>}, P);
var lp = proj.pj_inv({x: <easting in meters>, y: <northing in meters>}, P);

# transform arrays of coordinates from one coordinate system to another
proj.pj_transform(<source crs>, <dest crs>, <x array>, <y array>[, <z array>]);
Error handling

The x and y coordinates of unprojectable points are set to Infinity. Other errors cause an Error to be thrown containing an appropriate message.

Building

mapshaper-proj uses the (old-fashioned) technique of concatenating source files and wrapping them in a function to create a module with a shared scope. This method allows for global variables that are invisible outside of the program, making porting from the original C much simpler than if we were to make each source file a separate module.

Running build creates a build containing all supported projections in the dist/ directory.

Running build merc,lcc,aea creates a build containing only the listed projections. You can customize the comma-separated list to include only the projections that you want. Run mproj -l to see a list of all supported projections.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].