ropensci / parzer

Parse geographic coordinates
https://docs.ropensci.org/parzer
Other
63 stars 6 forks source link

convert_lon doesn't correctly fail on a complex #20

Closed sckott closed 4 years ago

sckott commented 4 years ago
parse_lon("-45.23232e24")
#> [1] -45.63232

parse_lat("-45.23232e24")
#> [1] NaN
#> Warning message:
#> In pz_parse_lat(lat) : invalid characters, got: -45.23232e24

whereas parse_lat throws a warning, parse_lon does not,

should have to do with this line https://github.com/ropensci/parzer/blob/master/src/latlong.cpp#L234 in which we don't check for an e

prob. have to separately check if an e is found, that it can't be followed by any digits