geojson-is-valid

0.0.5 • Public • Published

Geojson is valid

NPM

Media Suite

Build Status

This module provides a very light wrapper around the work the file folks at mapbox have been doing with geojsonhint to provide simple boolean checks on geojson objects

Usage

npm install --save geojson-is-valid
var isValid = require('geojson-is-valid')
 
var validGeojsonFeature = {
  type: 'Feature',
  id: 'way/4243736',
  properties: {
    highway: 'trunk'
  },
  geometry: {
    type: 'LineString',
    coordinates: [
      [
        172.5498622,
        -43.4932694
      ],
      [
        172.5498622,
        -43.4932694
      ]
    ]
  }
}
 
var validGeojsonCollection = {
  type: 'FeatureCollection',
  features: [ validFeature ]
}
 
isValid(validGeojsonFeature) //true
isValid(validGeojsonCollection) //true
isValid('something else') //false

/geojson-is-valid/

    Package Sidebar

    Install

    npm i geojson-is-valid

    Weekly Downloads

    11

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • digitalsadhu