Skip to content
Permalink
Browse files

[FEATURE] Delimited text provider supports curved WKT geometries

  • Loading branch information
nyalldawson committed Dec 22, 2015
1 parent 06553db commit f994e71d39db953f9067dc485d0331cf8d2cfab4
@@ -1148,7 +1148,7 @@ bool QgsDelimitedTextProvider::isValid()

int QgsDelimitedTextProvider::capabilities() const
{
return SelectAtId | CreateSpatialIndex;
return SelectAtId | CreateSpatialIndex | CircularGeometries;
}


@@ -466,7 +466,7 @@ def test_011_read_wkt():
wanted['log'] = [
u'Errors in file testwkt.csv',
u'1 records discarded due to invalid geometry definitions',
u'7 records discarded due to incompatible geometry types',
u'10 records discarded due to incompatible geometry types',
u'The following lines were not loaded into QGIS due to errors:',
u'Invalid WKT at line 8',
]
@@ -513,7 +513,7 @@ def test_012_read_wkt_point():
wanted['log'] = [
u'Errors in file testwkt.csv',
u'1 records discarded due to invalid geometry definitions',
u'7 records discarded due to incompatible geometry types',
u'10 records discarded due to incompatible geometry types',
u'The following lines were not loaded into QGIS due to errors:',
u'Invalid WKT at line 8',
]
@@ -556,11 +556,23 @@ def test_013_read_wkt_line():
'#fid': 14,
'#geometry': 'LineString (10 20, 11 21)',
},
15: {
'id': u'14',
'description': u'CircularString',
'#fid': 15,
'#geometry': 'CircularString (268 415, 227 505, 227 406)',
},
17: {
'id': u'16',
'description': u'CompoundCurve',
'#fid': 17,
'#geometry': 'CompoundCurve ((5 3, 5 13), CircularString(5 13, 7 15, 9 13), (9 13, 9 3), CircularString(9 3, 7 1, 5 3))',
},
}
wanted['log'] = [
u'Errors in file testwkt.csv',
u'1 records discarded due to invalid geometry definitions',
u'7 records discarded due to incompatible geometry types',
u'8 records discarded due to incompatible geometry types',
u'The following lines were not loaded into QGIS due to errors:',
u'Invalid WKT at line 8',
]
@@ -585,11 +597,17 @@ def test_014_read_wkt_polygon():
'#fid': 7,
'#geometry': 'MultiPolygon (((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,14 14)),((30 30,30 35,35 35,30 30)))',
},
16: {
'id': u'15',
'description': u'CurvePolygon',
'#fid': 16,
'#geometry': 'CurvePolygon (CircularString (1 3, 3 5, 4 7, 7 3, 1 3))',
},
}
wanted['log'] = [
u'Errors in file testwkt.csv',
u'1 records discarded due to invalid geometry definitions',
u'10 records discarded due to incompatible geometry types',
u'12 records discarded due to incompatible geometry types',
u'The following lines were not loaded into QGIS due to errors:',
u'Invalid WKT at line 8',
]
@@ -12,4 +12,6 @@ id|description|geom_wkt
11|Measure in line|LINESTRING(10.0 20.0 30.0, 11.0 21.0 31.0)
12|Z in line|LINESTRING Z(10.0 20.0 30.0, 11.0 21.0 31.0)
13|Measure and Z in line|LINESTRING ZM(10.0 20.0 30.0 40.0, 11.0 21.0 31.0 41.0)

14|CircularString|CIRCULARSTRING(268 415,227 505,227 406)
15|CurvePolygon|CURVEPOLYGON(CIRCULARSTRING(1 3, 3 5, 4 7, 7 3, 1 3))
16|CompoundCurve|COMPOUNDCURVE((5 3, 5 13), CIRCULARSTRING(5 13, 7 15, 9 13), (9 13, 9 3), CIRCULARSTRING(9 3, 7 1, 5 3))

0 comments on commit f994e71

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