Comparing version 1.1.0 to 1.1.1
43
index.js
var geometryArea = require('geojson-area').geometry; | ||
/** | ||
* Given any kind of GeoJSON feature, return the area of that feature, | ||
* Takes a {@link GeoJSON} feature or {@link FeatureCollection} of any type and returns the area of that feature | ||
* in square meters. | ||
* | ||
* @module turf/area | ||
* @param {GeoJSON} input | ||
* @category measurement | ||
* @param {GeoJSON} input a {@link Feature} or {@link FeatureCollection} of any type | ||
* @return {Number} area in square meters | ||
* @example | ||
* var polygons = turf.featurecollection([ | ||
* turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]), | ||
* turf.polygon([[[10,0],[20,10],[20,20], [20,0]]])]); | ||
* var polygons = { | ||
* "type": "FeatureCollection", | ||
* "features": [ | ||
* { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Polygon", | ||
* "coordinates": [[ | ||
* [-67.031021, 10.458102], | ||
* [-67.031021, 10.53372], | ||
* [-66.929397, 10.53372], | ||
* [-66.929397, 10.458102], | ||
* [-67.031021, 10.458102] | ||
* ]] | ||
* } | ||
* }, { | ||
* "type": "Feature", | ||
* "properties": {}, | ||
* "geometry": { | ||
* "type": "Polygon", | ||
* "coordinates": [[ | ||
* [-66.919784, 10.397325], | ||
* [-66.919784, 10.513467], | ||
* [-66.805114, 10.513467], | ||
* [-66.805114, 10.397325], | ||
* [-66.919784, 10.397325] | ||
* ]] | ||
* } | ||
* } | ||
* ] | ||
* }; | ||
* | ||
* var area = turf.area(polygons); | ||
* | ||
* //=area | ||
@@ -15,0 +48,0 @@ */ |
{ | ||
"name": "turf-area", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "calculate the area of a polygon or multipolygon feature", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "tape test.js" | ||
"test": "tape test.js", | ||
"doc": "dox -r < index.js | doxme --readme > README.md" | ||
}, | ||
@@ -25,4 +26,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"tape": "^3.0.3" | ||
"tape": "^3.5.0", | ||
"dox": "^0.6.1", | ||
"doxme": "^1.4.3" | ||
} | ||
} |
@@ -1,35 +0,43 @@ | ||
turf-area | ||
========== | ||
# turf-area | ||
[![Build Status](https://travis-ci.org/Turfjs/turf-area.svg)](https://travis-ci.org/Turfjs/turf-area) | ||
[![build status](https://secure.travis-ci.org/Turfjs/turf-area.png)](http://travis-ci.org/Turfjs/turf-area) | ||
Calculates the total geographical area in meters squared of any GeoJSON object. | ||
calculate the area of a polygon or multipolygon feature | ||
### Install | ||
```sh | ||
npm install turf-area | ||
``` | ||
### `turf.area(input)` | ||
Given any kind of GeoJSON feature, return the area of that feature, | ||
in square meters. | ||
### Parameters | ||
|name|description| | ||
|---|---| | ||
|input|FeatureCollection, Polygon, or MultiPolygon| | ||
| parameter | type | description | | ||
| --------- | ------- | ----------- | | ||
| `input` | GeoJSON | | | ||
### Usage | ||
### Example | ||
```js | ||
area(input) | ||
var polygons = turf.featurecollection([ | ||
turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]), | ||
turf.polygon([[[10,0],[20,10],[20,20], [20,0]]])]); | ||
var area = turf.area(polygons); | ||
//=area | ||
``` | ||
### Example | ||
## Installation | ||
```js | ||
var getArea = require('turf-area') | ||
var polygon = require('turf-polygon') | ||
var poly1 = polygon([[[0,0],[10,0],[10,10], [0,10]]]) | ||
var area = getArea(poly1) | ||
Requires [nodejs](http://nodejs.org/). | ||
console.log(area) | ||
```sh | ||
$ npm install turf-area | ||
``` | ||
## Tests | ||
```sh | ||
$ npm test | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5820
176
44
0
3