JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2967
  • Score
    100M100P100Q42191F
  • License BSD

validate and sanity-check geojson files

Package Exports

  • geojsonhint

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geojsonhint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

geojsonhint: complete standards-based validation for geojson

A lint tool for the GeoJSON standard. geojsonhint is written to the standard, with no missing or additional opinions about structure.

Thanks to jsonlint-lines, GeoJSON that is also not valid JSON will return informative, line-oriented parsing errors.

api

errors = geojsonhint.hint(fileAsString)

Lint a file - given as a string - with the GeoJSON expectations baked in. An example of the output:

[{
  "message": "\"features\" property should be an array, but is an object instead",
  "line": 1
}]

use it

as a library

npm install --save geojsonhint

as a web library

curl https://raw.github.com/mapbox/geojsonhint/master/geojsonhint.js > geojsonhint.js

binary

Install:

npm install -g geojsonhint
➟ geojsonhint
Usage: geojsonhint FILE.geojson

Options:
  --json  output json-formatted data for hints
➟ geojsonhint test.geojson
line 9, each element in a position must be a number

developing

Tests:

npm test

Building the browser version:

npm install -g browserify
make

See Also