turf-meta

WebJar for turf-meta

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-meta
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-meta
WebJar for turf-meta
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

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

Download turf-meta

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

turf-meta

build status

Functional helpers for Turf modules.

Why? Because many turf modules have a similar pattern of running some operation over every coordinate or property object, etc. This module unifies those patterns into one structure and make sure that turf is able to handle unusual structures (geometry roots, null geometries, geometrycollections, and so on). It's also quite fast - it uses monomorphic functions as much as possible and avoids copying data unnecessarily.

coordEach(layer, callback)

Lazily iterate over coordinates in any GeoJSON object, similar to Array.forEach.

  • layer (Object): any GeoJSON object
  • callback (Function): a method that takes (value)
var point = { type: 'Point', coordinates: [0, 0] };
coordEach(point, function(coords) {
  // coords is equal to [0, 0]
});

coordReduce(layer, callback, memo)

Lazily reduce coordinates in any GeoJSON object into a single value, similar to how Array.reduce works. However, in this case we lazily runthe reduction, so an array of all coordinates is unnecessary.

  • layer (Object): any GeoJSON object
  • callback (Function): a method that takes (memo, value) and returns a new memo
  • memo (``): the starting value of memo: can be any type.

propEach(layer, callback)

Lazily iterate over property objects in any GeoJSON object, similar to Array.forEach.

  • layer (Object): any GeoJSON object
  • callback (Function): a method that takes (value)
var point = { type: 'Feature', geometry: null, properties: { foo: 1 } };
propEach(point, function(props) {
  // props is equal to { foo: 1}
});

propReduce(layer, callback, memo)

Lazily reduce properties in any GeoJSON object into a single value, similar to how Array.reduce works. However, in this case we lazily runthe reduction, so an array of all properties is unnecessary.

  • layer (Object): any GeoJSON object
  • callback (Function): a method that takes (memo, coord) and returns a new memo
  • memo (``): the starting value of memo: can be any type.
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

Versions

Version
3.0.12