Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 504 Bytes

File metadata and controls

21 lines (16 loc) · 504 Bytes

Validates geojson using is-my-json-valid. Based off of the geojsonlint design & adapted as a module.

Installation

npm install geojsonvalidator

usage

var geoval = require("geojsonvalidator");

var polygon = { "type": "Polygon",
    "coordinates": 
    [
    	[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
    ]
}

geoval.validate(polygon)
//returns true or returns false with helpful error message: