1.2.0 • Published 7 years ago

validity-geojson-point v1.2.0

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

Validity-GeoJSON-Point

A validity style validator for GeoJSON Points

Installation

npm install --save validity-geojson-point

Usage

This module is designed to be used with Schemata:

var validateGeojson = require('./validator')
  , schemata = require('schemata')

  , schema = schemata(
    { location:
      { type: Object
      , validators: { all: [ validateGeojson ] }
      }
    }
  )

schema.validate(
  { location:
    { type: 'Point'
    , coordinates: [ -0.439069, 51.6933176 ]
    }
  }
, function (err, errors) {
  // errors = {}
})

schema.validate(
  { location:
    { type: 'Dinosaur'
    , foo: 'bar'
    }
  }
, function (err, errors) {
  // errors = { location: 'Location must be a valid GeoJson Point' }
})
1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago