Tools for Validating 'GeoJSON'

Tools for linting 'GeoJSON'. Includes tools for interacting with the online tool <>, the 'Javascript' library 'geojsonhint' (<>), and validating against a 'GeoJSON' schema via the 'Javascript' library (<>). Some tools work locally while others require an internet connection.

cran checks Build Status rstudio mirror downloads cran version

GeoJSON linters available in geojsonlint

All three functions return the same outputs. If the GeoJSON is valid, they return TRUE. If the GeoJSON is invalid, they return FALSE, plus reason(s) that the GeoJSON is invalid in an attribute named errors as a data.frame. The fields in the data.frame's are not the same across functions unfortunately, but they can be easily coerced to combine via e.g., plyr::rbind.fill or dplyr::bind_rows or data.table::rbindlist(fill = TRUE)

The parameters for the three functions are similar, though geojson_validate() has an extra parameter greedy that's not available in the others, and geojson_hint() has ... parameter to pass on curl options as it works with a web service.

from CRAN


Dev version


Good GeoJSON web service

geojson_lint(x = '{"type": "Point", "coordinates": [-100, 80]}')
#> [1] TRUE

geojsonhint JS library

geojson_hint(x = '{"type": "Point", "coordinates": [-100, 80]}')
#> [1] TRUE

is-my-json-valid JS library

geojson_validate(x = '{"type": "Point", "coordinates": [-100, 80]}')
#> [1] TRUE

Bad GeoJSON web service

geojson_lint('{"type": "FooBar"}')
#> [1] FALSE

geojsonhint JS library

geojson_hint('{"type": "FooBar"}')
#> [1] FALSE

is-my-json-valid JS library

geojson_validate('{ "type": "FeatureCollection" }')
#> [1] FALSE

Bad GeoJSON - with reason for failure web service

geojson_lint('{"type": "FooBar"}', inform = TRUE)
#> [1] FALSE
#> attr(,"errors")
#>                                 message status
#> 1 "FooBar" is not a valid GeoJSON type.  error

geojsonhint JS library

geojson_hint('{"type": "FooBar"}', inform = TRUE)
#> [1] FALSE
#> attr(,"errors")
#>   line                    message
#> 1    1 The type FooBar is unknown

is-my-json-valid JS library

geojson_validate('{ "type": "FeatureCollection" }', inform = TRUE)
#> [1] FALSE
#> attr(,"errors")
#>   field                             message
#> 1  data no (or more than one) schemas match

Bad GeoJSON - stop on validation failure web service

geojson_lint('{"type": "FooBar"}', error = TRUE)
#> Error: invalid GeoJSON
#>    - "FooBar" is not a valid GeoJSON type.

geojsonhint JS library

geojson_hint('{"type": "FooBar"}', error = TRUE)
#> Error: Line 1
#>    - The type FooBar is unknown

is-my-json-valid JS library

geojson_validate('{ "type": "FeatureCollection" }', error = TRUE)
#> Error: 1 error validating json:
#>  - data: no (or more than one) schemas match


  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for geojsonlint in R doing citation(package = 'geojsonlint')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



geojsonlint 0.3.0


  • update JS library geojsonhint to v2.1.0 (#11)
  • replace httr with crul (#12)
  • the parameter verbose replaced with inform throughout the package. take note if you have verbose parameter in use in any R code

geojsonlint 0.2.0


geojsonlint 0.1.0


  • released to CRAN

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.4.0 by Scott Chamberlain, a year ago (devel) (docs)

Report a bug at

Browse source code at

Authors: Scott Chamberlain [aut, cre] , Andy Teucher [aut] , Tom MacWright [cph] (geojsonhint Javascript library) , Mads Kristensen [cph] (geojson schema)

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports crul, jsonlite, jsonvalidate, V8

Suggests testthat, knitr, rmarkdown

Imported by rmapshaper.

Suggested by MODIStsp, geojson, sen2r.

See at CRAN