New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

local-proj

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-proj

Find a local projection from GeoJSON data

latest
Source
npmnpm
Version
2.0.2
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

local-proj

npm version Build status

Find a projection for easy cartesian calculations, given a GeoJSON in WGS84.

Problem: you have geographic data in WGS84 of limited extent, but arbitrary location, and you need to work with the data in a cartesian system (use euclidean distance, etc.)

Solution: feed your data to local-proj, and it will hand you a suitable projection independent of geographic location

Installing

npm install --save local-proj

Example

var localProj = require('local-proj');
var geojson = [...]

var projection = localProj.find(geojson);

var cartesian = projection.forward(geojsoncoord);

To reproject your GeoJSON to the projection, you might want to look at reproject.

API

find(geojson)

Finds a local projection that is suitable for projecting the geojson to cartesian coordinates.

The returned projection is a proj4 projection object (proj4.Proj), which you can use to create transforms to and from other projections.

Note that the local coordinate system will only work as expected for datasets up to a couple of hundred kilometers in size.

Currently, the returned projection will always be a transverse mercator projection.

Keywords

geojson

FAQs

Package last updated on 05 Apr 2017

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