More tolerant when parsing GPS coordinates.

Refactored the parsing logic to make it more solid (no more guessing) and
more flexible (support more formats).
Added a test for checking that.
Fixed a few warnings.

[Dirk Hohndel: some changes to coding style]

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Patrick Valsecchi 2015-02-04 09:30:24 +01:00 committed by Dirk Hohndel
parent d47778fcbd
commit 822cce1ef7
5 changed files with 240 additions and 113 deletions

View file

@ -277,6 +277,9 @@ Southern hemisphere latitudes are given with a *S*, e.g. S30°, or with a
negative value, e.g. -30.22496. Similarly western longitudes are given with a
*W*, e.g. W07°, or with a negative value, e.g. -7.34323.
Some keyboards don't have the degree sign (°). It can be replaced by a d like
that: N30d W20d.
Please note that GPS coordinates of a dive site are linked to the Location
name - so adding coordinates to dives that do not have a location description
will cause unexpected behaviour (Subsurface will think that all of these