SymbolixAU / geojsonsf

Conversion between sf and geojson
Other
82 stars 7 forks source link

descriptive error messages #57

Closed SymbolixAU closed 5 years ago

SymbolixAU commented 5 years ago

Currently

geojsonsf::geojson_sf('{"type":"Point","coordinates":[[0,0]]}')

Invalid lon/lat object

Would be good if it told you why it failed, something like

Point object has too many braces

Or

geojsonsf::geojson_sf('{"type":"Point","coordinates":[[0,0],[1,1]]}')

Specified 'POINT' but found 'MULTIPOINT'


Maybe also an 'auto_convert' option, so it would convert the POINT to MULTIPOINT on the fly?

SymbolixAU commented 5 years ago

At the point of validation we don't know what the type of object is that we are checking. All the geometries are checked at the POINT-level. Also, auto-converting is a lot of work which I'm not going to implement any time soon.