Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for degrees/minutes format
  • Loading branch information
ccrook committed Apr 15, 2013
1 parent bee4852 commit 863a3f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -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 )
Expand Down
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsdelimitedtextprovider.py
Expand Up @@ -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?
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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=[
Expand Down

0 comments on commit 863a3f7

Please sign in to comment.