@nextgis/area
TypeScript icon, indicating that this package has built-in type declarations

2.2.3 • Public • Published

Area

size version

Dependencies free QGIS ellipsoidal area calculation reproduced in JavaScript.

also look at the Python implementation

Installation

In Browser

Include assets

Simply download and include with a script tag, Area will be registered as a global variable.

<script src="../lib/area.global.js"></script>

<script>
  var area = Area.calculateArea([
    [51.82, 63.8],
    [43.48, 55.62],
    [75.38, 59.13],
    [51.82, 63.8], // the first and last positions MUST contain identical values
  ]);
  var area = Area.geojsonArea(geojson);
</script>

CDN

unpkg

<script src="https://unpkg.com/@nextgis/area"></script>

jsdelivr

<script src="https://cdn.jsdelivr.net/npm/@nextgis/area"></script>

We recommend linking to a specific version number /area@[version]

In Node.js

npm install @nextgis/area

Usage

import { calculateArea, geojsonArea } from '@nextgis/area';

const area = geojsonArea(geojson);
const area2 = calculateArea([
  [51.82, 63.8],
  [43.48, 55.62],
  [75.38, 59.13],
  [51.82, 63.8], // the first and last positions MUST contain identical values
]);
console.log(area2); // 730215205638.4752

Check out the API Documentation

Notes

Implementations and code in other software, languages

Commercial support

Need to fix a bug or add a feature to @nextgis/area? We provide custom development and support for this software. Contact us to discuss options!

http://nextgis.com

Readme

Keywords

Package Sidebar

Install

npm i @nextgis/area

Weekly Downloads

11

Version

2.2.3

License

MIT

Unpacked Size

78 kB

Total Files

21

Last publish

Collaborators

  • rendrom
  • maximdubinin
  • karavanjo