Skip to content
Permalink
Browse files

Fix for degrees/minutes format

  • Loading branch information
ccrook committed Apr 15, 2013
1 parent bee4852 commit 863a3f7afec1ba09c0a4bb6dd49995217d2c65c9
@@ -48,7 +48,7 @@ static const QString TEXT_PROVIDER_DESCRIPTION = "Delimited text data provider";
QRegExp QgsDelimitedTextProvider::WktPrefixRegexp( "^\\s*(?:\\d+\\s+|SRID\\=\\d+\\;)", Qt::CaseInsensitive );
QRegExp QgsDelimitedTextProvider::WktZMRegexp( "\\s*(?:z|m|zm)(?=\\s*\\()", Qt::CaseInsensitive );
QRegExp QgsDelimitedTextProvider::WktCrdRegexp( "(\\-?\\d+(?:\\.\\d*)?\\s+\\-?\\d+(?:\\.\\d*)?)\\s[\\s\\d\\.\\-]+" );
QRegExp QgsDelimitedTextProvider::CrdDmsRegexp( "^\\s*(?:([-+nsew])\\s*)?(\\d{1,3})(?:[^0-9]+([0-5]?\\d))?[^0-9]+([0-5]?\\d(?:\\.\\d+)?)[^0-9]*([-+nsew])?\\s*$", Qt::CaseInsensitive );
QRegExp QgsDelimitedTextProvider::CrdDmsRegexp( "^\\s*(?:([-+nsew])\\s*)?(\\d{1,3})(?:[^0-9.]+([0-5]?\\d))?[^0-9.]+([0-5]?\\d(?:\\.\\d+)?)[^0-9.]*([-+nsew])?\\s*$", Qt::CaseInsensitive );

QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
: QgsVectorDataProvider( uri )
@@ -55,7 +55,7 @@


geomkey = "#geometry"
tolerance = 0.00001 # Tolerance for coordinate comparisons in checkWktEqual
tolerance = 0.000001 # Tolerance for coordinate comparisons in checkWktEqual

# Thought we could connect to messageReceived signal but doesn't seem to be available
# in python :-( Not sure why?
@@ -177,8 +177,8 @@ def checkWktEqual( wkt1, wkt2 ):
if wkt1 == wkt2: return True
# Use regex split with capture gropu to split into text and numbers
numberre=re.compile(r'(\-?\d+(?:\.\d+)?)')
p1=re.split(wkt1)
p2=re.split(wkt2)
p1=numberre.split(wkt1)
p2=numberre.split(wkt2)
if len(p1) != len(p2): return False
for i in range(len(p1)):
if i%2 == 1:
@@ -854,7 +854,7 @@ def test_013_read_dms_xy(self):
'description': u'Degrees/minutes format',
'lon': u'1 05.23',
'lat': u'4 55.03',
'#geometry': 'POINT(1.08972222 4.9175)',
'#geometry': 'POINT(1.08716667 4.91716667)',
},
}
log_wanted=[

0 comments on commit 863a3f7

Please sign in to comment.
You can’t perform that action at this time.