How to check if loop is closed using turf booleanValid in TypeScript? #2496
-
I use TypeScript and currently I wish to validate a Geometry object.
After testing I found out that the
I need a way to check all the validations for Geometry and not just one or some of them |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is some history to the I personally would say in it's current state not to rely on booleanValid for comprehensive GeoJSON validation. You could potentially look at packages such as https://github.com/placemark/check-geojson and https://github.com/mapbox/geojsonhint which may offer similar alternatives depending on your requirements. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your swift reply and sorry for mine being late. I would like to ask if there is one of these you use or prefer and if there are other alternatives as both options you suggested don't have a high score on snykAdvisor. I need to validate geometry objects before saving them into the database so if you wished to do the same which package would you use? |
Beta Was this translation helpful? Give feedback.
There is some history to the
booleanValid
package that may give some context about why it is not listed in the documentation: #1918I personally would say in it's current state not to rely on booleanValid for comprehensive GeoJSON validation. You could potentially look at packages such as https://github.com/placemark/check-geojson and https://github.com/mapbox/geojsonhint which may offer similar alternatives depending on your requirements.