Skip to main content
Version: 7.0.0

booleanValid

Description

booleanValid checks if the geometry is a valid according to the OGC Simple Feature Specification.

Parameters

NameTypeDescription
featureGeometry | Feature<any>GeoJSON Feature or Geometry

Returns

    boolean true/false

Examples

var line = turf.lineString([
[1, 1],
[1, 2],
[1, 3],
[1, 4],
]);

turf.booleanValid(line); // => true
turf.booleanValid({ foo: "bar" }); // => false

Installation

$ npm install @turf/boolean-valid

import { booleanValid } from "@turf/boolean-valid";
const result = booleanValid(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.booleanValid(...);