mapbox/mapbox-cli-py

Possible mapbox cli bug?

Closed this issue · 5 comments

In closed issues I've found similar reports, but it seems that subsequent updates—I'm using v0.3.1—haven't dealt with the problem. I'm occasionally getting error messages (see screenshot below); in this case mapbox-cli-py is part of a shell script that runs within BitBar.

mapbox_error

@JayBrown what are the input parameters that cause the error?

Have you confirmed that CURRENT_LAT and CURRENT_LONG are valid numbers? It looks like your script needs to guard against invalid locations, i.e. accounting for unset variables (set -u) and https://github.com/JayBrown/VBBar/blob/master/VBBar.30m.sh#L373-L374

I can reproduce the error using the following (invalid) command:

$ mapbox geocoding --reverse "[ , ]" -t address

A ValueError is the expected behavior since the --reverse argument needs to be an array with two numeric (float) coordinates. Your script should guard against this condition and avoid making a call to the mapbox API unless you have a valid lat and lon.

Thank you. I just included another condition for the mapbox query. Hope it'll work.