mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Improving matching of ISO 6709 GPS format
ISO 6709 format dictates that the format includes characters ° (degree), ' and ". If we only test for the coordinates starting with decimal, we match also the decimal notation on this test. Thus adding test for the degree sign not to match input as ISO 6709 when coordinates are given in decimal notation. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
23973e8abd
commit
e4f2c86c82
1 changed files with 1 additions and 1 deletions
|
@ -119,7 +119,7 @@ bool parseGpsText(const QString& gps_text, double *latitude, double *longitude)
|
|||
|
||||
// ISO 6709 Annex D representation
|
||||
// http://en.wikipedia.org/wiki/ISO_6709#Representation_at_the_human_interface_.28Annex_D.29
|
||||
if (gps_text.at(0).isDigit()) {
|
||||
if (gps_text.at(0).isDigit() && gps_text.count(UTF8_DEGREE) > 0) {
|
||||
gpsStyle = ISO6709D;
|
||||
regExp = QString("(\\d+)[" UTF8_DEGREE "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([NS%1%2])"
|
||||
"\\s*(\\d+)[" UTF8_DEGREE "\\s](\\d+)[\'\\s](\\d+)([,\\.](\\d+))?[\"\\s]([EW%3%4])")
|
||||
|
|
Loading…
Add table
Reference in a new issue