1.0.0 • Published 8 years ago

turf-isvalid v1.0.0

Weekly downloads
86
License
ISC
Repository
github
Last release
8 years ago

turf-isvalid

build status

Test if a geometry is valid or not

turf.valid(Feature)

Parameters

parametertypedescription
FeatureFeatureinput to be tested if valid or not

Example

var poly = {
  "type": "Feature",
  "properties": {
    "fill": "#0f0"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-122.801742, 45.48565],
    ]]
  }
}

var isvald = turf.valid(poly);
console.log(isvald)
//=true

Returns Boolean,

Installation

Requires nodejs.

$ npm install turf-isvalid

Tests

$ npm test