Adonis GeoJSON Validator
Easy GeoJSON validation for adonis framework.
Installation
- Add package:
$ npm i adonis-geojson-validator --save
or
$ yarn add adonis-geojson-validator
- Register providers inside the your start/app.js file.
const providers = ... 'adonis-geojson-validator/providers/GeoJsonValidatorProvider' ...
Validation example
const rules = geojson: 'geojson:feature_collection' const data = geojson: type: 'FeatureCollection' features: type: 'Feature' geometry: type: 'Point' coordinates: 1020 05 properties: prop0: 'value0' type: 'Feature' geometry: type: 'LineString' coordinates: 1020 00 1030 10 1040 00 1050 10 properties: prop0: 'value0' prop1: 00 await Validator
Supported types:
- geometry_object
- position
- point
- multi_point_coords
- multi_point
- line_string_coords
- line_string
- multi_line_string_coords
- multi_line_string
- polygon_coords
- polygon
- multi_polygon_coords
- multi_polygon
- geometry_collection
- feature
- feature_collection
- bbox
Credits
Support
Having trouble? Open an issue!
License
The MIT License (MIT). Please see License File for more information.