turf-centroid

WebJar for turf-centroid

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

turf-centroid
Последняя версия

Последняя версия

3.0.12
Дата

Дата

Тип

Тип

jar
Описание

Описание

turf-centroid
WebJar for turf-centroid
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/turf-junkyard/turf-centroid

Скачать turf-centroid

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-centroid/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-centroid</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-centroid/
implementation 'org.webjars.npm:turf-centroid:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-centroid/
implementation ("org.webjars.npm:turf-centroid:3.0.12")
'org.webjars.npm:turf-centroid:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-centroid" rev="3.0.12">
  <artifact name="turf-centroid" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-centroid', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-centroid" % "3.0.12"
[org.webjars.npm/turf-centroid "3.0.12"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : turf-meta jar [3.0.12,4)
org.webjars.npm : turf-helpers jar [3.0.12,4)

Модули Проекта

Данный проект не имеет модулей.

turf-centroid

build status

turf centroid module

turf.centroid(features)

Takes one or more features and calculates the centroid using the arithmetic mean of all vertices. This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons.

Parameters

parameter type description
features Feature,FeatureCollection input features

Example

var poly = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [105.818939,21.004714],
      [105.818939,21.061754],
      [105.890007,21.061754],
      [105.890007,21.004714],
      [105.818939,21.004714]
    ]]
  }
};

var centroidPt = turf.centroid(poly);

var result = {
  "type": "FeatureCollection",
  "features": [poly, centroidPt]
};

//=result

Returns Feature.<Point>, the centroid of the input features

Installation

Requires nodejs.

$ npm install turf-centroid

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Версии библиотеки

Версия
3.0.12