1.0.0 • Published 10 years ago

turf-geometrycollection v1.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

turf-geometrycollection

build status

turf geometrycollection module

turf.geometrycollection(geometries, properties)

Creates a Feature based on a coordinate array. Properties can be added optionally.

Parameters

parametertypedescription
geometriesArray.\<{ Geometry: * }>an array of GeoJSON Geometries
propertiesObjectoptional: an Object of key-value pairs to add as properties

Example

var pt = { 
    "type": "Point",
      "coordinates": [100, 0]
    };
var line = {
    "type": "LineString",
    "coordinates": [ [101, 0], [102, 1] ]
  };
var collection = turf.geometrycollection([[0,0],[10,10]]);

//=collection

Returns Feature.<GeometryCollection>, a geometrycollection feature

Installation

Requires nodejs.

$ npm install turf-geometrycollection

Tests

$ npm test