Decimal format that Google maps uses does not have the NSEW characters, just pure numbers (with minus sign in the front if needed). And we really need to support the copy-paste format from Google maps, IMO.
To re-enable the side-effect feature you ask for would require changing the degree sign to '. (Patch attached) miika On Sun, Jan 12, 2014 at 11:17 PM, Tim Wootton <[email protected]>wrote: > The decimal format we had before seemed to want N, S, E or W as the 1st > non-whitespace character which is why I used the absence of that as the > selector, or did I miss something? If you continue to do that ISO doesn't > break the old decimal. > > This breaks what seemed a nice side-effect in the ISO format decoding > which was if you leave spaces where the awkward degree symbols belong > subsurface added them for you. > > > > > On 12/01/14 05:37, Miika Turkia wrote: > >> 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 <[email protected]> >> --- >> qthelper.cpp | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/qthelper.cpp b/qthelper.cpp >> index 9d503cb..cd47209 100644 >> --- a/qthelper.cpp >> +++ b/qthelper.cpp >> @@ -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])") >> >> >
From 4b3c26490fcb82d1692729dd6ccd74b97a32ce26 Mon Sep 17 00:00:00 2001 From: Miika Turkia <[email protected]> Date: Mon, 13 Jan 2014 06:31:53 +0200 Subject: [PATCH] Use ' character to recognize ISO 6709 GPS format If we use ' character as part of the detection of ISO 6709 format, one can use space instead of degree sign when entering coordinates. Signed-off-by: Miika Turkia <[email protected]> --- qthelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qthelper.cpp b/qthelper.cpp index cd47209..df979cd 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -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() && gps_text.count(UTF8_DEGREE) > 0) { + if (gps_text.at(0).isDigit() && gps_text.count(QChar('\'')) > 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])") -- 1.8.3.2
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
