fix bug in parsing negativelat/lon

master
Michal Fratczak 2024-01-21 23:10:19 +01:00
rodzic 7ac670409b
commit f1ccd435d4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -117,10 +117,10 @@ float parse_gps_pos(const std::string lat_or_lon)
}
//check if this NMEA DDMM.MMMM or usual decimal DD.DDDD
size_t decimal_pos = coord.find('.');
const size_t decimal_pos = coord.find('.');
if(decimal_pos == 2 || decimal_pos == 3)
return stof(coord); // usual decimal
return stof(lat_or_lon); // usual decimal
// this is NMEA format
if(decimal_pos == 4) { // latitude