turf-center

WebJar for turf-center

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

3.0.12
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

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

Скачать turf-center

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

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

Зависимости

compile (2)

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

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

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

turf-center

build status

turf center module

turf.center(features)

Takes a FeatureCollection and returns the absolute center point of all features.

Parameters

parameter type description
features FeatureCollection input features

Example

var features = {
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.522259, 35.4691]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.502754, 35.463455]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.508269, 35.463245]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.516809, 35.465779]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.515372, 35.467072]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.509363, 35.463053]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.511123, 35.466601]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.518547, 35.469327]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.519706, 35.469659]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.517839, 35.466998]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.508678, 35.464942]
      }
    }, {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Point",
        "coordinates": [-97.514914, 35.463453]
      }
    }
  ]
};

var centerPt = turf.center(features);
centerPt.properties['marker-size'] = 'large';
centerPt.properties['marker-color'] = '#000';

var resultFeatures = features.features.concat(centerPt);
var result = {
  "type": "FeatureCollection",
  "features": resultFeatures
};

//=result

Returns Feature.<Point>, a Point feature at the absolute center point of all input features

Installation

Requires nodejs.

$ npm install turf-center

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