turf-midpoint

WebJar for turf-midpoint

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-midpoint
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-midpoint
WebJar for turf-midpoint
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

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

Download turf-midpoint

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : turf-bearing jar [3.0.12,4)
org.webjars.npm : turf-destination jar [3.0.12,4)
org.webjars.npm : turf-distance jar [3.0.12,4)
org.webjars.npm : turf-invariant jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-midpoint

build status

turf midpoint module

turf.midpoint(pt1, pt2)

Takes two Point|points and returns a point midway between them.

Parameters

parameter type description
pt1 Feature.<Point> first point
pt2 Feature.<Point> second point

Example

var pt1 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [144.834823, -37.771257]
  }
};
var pt2 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [145.14244, -37.830937]
  }
};

var midpointed = turf.midpoint(pt1, pt2);
midpointed.properties['marker-color'] = '#f00';


var result = {
  "type": "FeatureCollection",
  "features": [pt1, pt2, midpointed]
};

//=result

Returns Feature.<Point>, a point midway between pt1 and pt2

Installation

Requires nodejs.

$ npm install turf-midpoint

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

Versions

Version
3.0.12