Fix and wkt formating for delimited text provider test

This commit is contained in:
Marco Hugentobler 2015-05-26 15:20:26 +02:00
parent 23ef9dafd2
commit 13d67c09cc
4 changed files with 141 additions and 134 deletions

View File

@ -147,6 +147,10 @@ const QgsAbstractGeometryV2* QgsGeometry::geometry() const
QgsGeometry* QgsGeometry::fromWkt( QString wkt )
{
QgsAbstractGeometryV2* geom = QgsGeometryImport::geomFromWkt( wkt );
if ( !geom )
{
return 0;
}
return new QgsGeometry( geom );
}

View File

@ -140,7 +140,10 @@ QgsAbstractGeometryV2* QgsGeometryImport::geomFromWkt( const QString& text )
if ( geom )
{
geom->fromWkt( text );
if ( !geom->fromWkt( text ) )
{
delete geom; return 0;
}
}
return geom;
}

View File

@ -389,7 +389,7 @@ def test_010_read_coordinates():
'geom_x': u'10.5',
'geom_y': u'20.82',
'#fid': 2L,
'#geometry': 'POINT(10.5 20.82)',
'#geometry': 'Point (10.5 20.82)',
},
3L: {
'id': u'2',
@ -397,7 +397,7 @@ def test_010_read_coordinates():
'geom_x': u'11.0',
'geom_y': u'22.0',
'#fid': 3L,
'#geometry': 'POINT(11.0 22.0)',
'#geometry': 'Point (11 22)',
},
5L: {
'id': u'4',
@ -405,7 +405,7 @@ def test_010_read_coordinates():
'geom_x': u'13.0',
'geom_y': u'23.0',
'#fid': 5L,
'#geometry': 'POINT(13.0 23.0)',
'#geometry': 'Point (13 23)',
},
}
wanted['log']=[
@ -426,31 +426,31 @@ def test_011_read_wkt():
'id': u'1',
'description': u'Point wkt',
'#fid': 2L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'Point (10 20)',
},
3L: {
'id': u'2',
'description': u'Multipoint wkt',
'#fid': 3L,
'#geometry': 'MULTIPOINT(10.0 20.0, 11.0 21.0)',
'#geometry': 'MultiPoint ((10 20),(11 21))',
},
9L: {
'id': u'8',
'description': u'EWKT prefix',
'#fid': 9L,
'#geometry': 'POINT(10.0 10.0)',
'#geometry': 'Point (10 10)',
},
10L: {
'id': u'9',
'description': u'Informix prefix',
'#fid': 10L,
'#geometry': 'POINT(10.0 10.0)',
'#geometry': 'Point (10 10)',
},
11L: {
'id': u'10',
'description': u'Measure in point',
'#fid': 11L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'Point (10 20)',
},
}
wanted['log']=[
@ -472,31 +472,31 @@ def test_012_read_wkt_point():
'id': u'1',
'description': u'Point wkt',
'#fid': 2L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'Point (10 20)',
},
3L: {
'id': u'2',
'description': u'Multipoint wkt',
'#fid': 3L,
'#geometry': 'MULTIPOINT(10.0 20.0, 11.0 21.0)',
'#geometry': 'MultiPoint ((10 20),(11 21))',
},
9L: {
'id': u'8',
'description': u'EWKT prefix',
'#fid': 9L,
'#geometry': 'POINT(10.0 10.0)',
'#geometry': 'Point (10 10)',
},
10L: {
'id': u'9',
'description': u'Informix prefix',
'#fid': 10L,
'#geometry': 'POINT(10.0 10.0)',
'#geometry': 'Point (10 10)',
},
11L: {
'id': u'10',
'description': u'Measure in point',
'#fid': 11L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'Point (10 20)',
},
}
wanted['log']=[
@ -518,31 +518,31 @@ def test_013_read_wkt_line():
'id': u'3',
'description': u'Linestring wkt',
'#fid': 4L,
'#geometry': 'LINESTRING(10.0 20.0, 11.0 21.0)',
'#geometry': 'LineString (10 20, 11 21)',
},
5L: {
'id': u'4',
'description': u'Multiline string wkt',
'#fid': 5L,
'#geometry': 'MULTILINESTRING((10.0 20.0, 11.0 21.0), (20.0 30.0, 21.0 31.0))',
'#geometry': 'MultiLineString ((10 20, 11 21), (20 30, 21 31))',
},
12L: {
'id': u'11',
'description': u'Measure in line',
'#fid': 12L,
'#geometry': 'LINESTRING(10.0 20.0, 11.0 21.0)',
'#geometry': 'LineString (10 20, 11 21)',
},
13L: {
'id': u'12',
'description': u'Z in line',
'#fid': 13L,
'#geometry': 'LINESTRING(10.0 20.0, 11.0 21.0)',
'#geometry': 'LineString (10 20, 11 21)',
},
14L: {
'id': u'13',
'description': u'Measure and Z in line',
'#fid': 14L,
'#geometry': 'LINESTRING(10.0 20.0, 11.0 21.0)',
'#geometry': 'LineString (10 20, 11 21)',
},
}
wanted['log']=[
@ -564,13 +564,13 @@ def test_014_read_wkt_polygon():
'id': u'5',
'description': u'Polygon wkt',
'#fid': 6L,
'#geometry': 'POLYGON((10.0 10.0,10.0 20.0,20.0 20.0,20.0 10.0,10.0 10.0),(14.0 14.0,14.0 16.0,16.0 16.0,14.0 14.0))',
'#geometry': 'Polygon ((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,14 14))',
},
7L: {
'id': u'6',
'description': u'MultiPolygon wkt',
'#fid': 7L,
'#geometry': 'MULTIPOLYGON(((10.0 10.0,10.0 20.0,20.0 20.0,20.0 10.0,10.0 10.0),(14.0 14.0,14.0 16.0,16.0 16.0,14.0 14.0)),((30.0 30.0,30.0 35.0,35.0 35.0,30.0 30.0)))',
'#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)))',
},
}
wanted['log']=[
@ -594,7 +594,7 @@ def test_015_read_dms_xy():
'lon': u'1 5 30.6',
'lat': u'35 51 20',
'#fid': 3L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
4L: {
'id': u'2',
@ -602,7 +602,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6005',
'lat': u'035 51 20',
'#fid': 4L,
'#geometry': 'POINT(1.09183347 35.85555556)',
'#geometry': 'Point (1.09183347 35.85555556)',
},
5L: {
'id': u'3',
@ -610,7 +610,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6',
'lat': u'35 59 9.99',
'#fid': 5L,
'#geometry': 'POINT(1.09183333 35.98610833)',
'#geometry': 'Point (1.09183333 35.98610833)',
},
7L: {
'id': u'4',
@ -618,7 +618,7 @@ def test_015_read_dms_xy():
'lon': u'n1 05 30.6',
'lat': u'e035 51 20',
'#fid': 7L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
8L: {
'id': u'5',
@ -626,7 +626,7 @@ def test_015_read_dms_xy():
'lon': u'N1 05 30.6',
'lat': u'E035 51 20',
'#fid': 8L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
9L: {
'id': u'6',
@ -634,7 +634,7 @@ def test_015_read_dms_xy():
'lon': u'N 1 05 30.6',
'lat': u'E 035 51 20',
'#fid': 9L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
10L: {
'id': u'7',
@ -642,7 +642,7 @@ def test_015_read_dms_xy():
'lon': u'S1 05 30.6',
'lat': u'W035 51 20',
'#fid': 10L,
'#geometry': 'POINT(-1.09183333 -35.85555556)',
'#geometry': 'Point (-1.09183333 -35.85555556)',
},
11L: {
'id': u'8',
@ -650,7 +650,7 @@ def test_015_read_dms_xy():
'lon': u'+1 05 30.6',
'lat': u'+035 51 20',
'#fid': 11L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
12L: {
'id': u'9',
@ -658,7 +658,7 @@ def test_015_read_dms_xy():
'lon': u'-1 05 30.6',
'lat': u'-035 51 20',
'#fid': 12L,
'#geometry': 'POINT(-1.09183333 -35.85555556)',
'#geometry': 'Point (-1.09183333 -35.85555556)',
},
14L: {
'id': u'10',
@ -666,7 +666,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6n',
'lat': u'035 51 20e',
'#fid': 14L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
15L: {
'id': u'11',
@ -674,7 +674,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6N',
'lat': u'035 51 20E',
'#fid': 15L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
16L: {
'id': u'12',
@ -682,7 +682,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6 N',
'lat': u'035 51 20 E',
'#fid': 16L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
17L: {
'id': u'13',
@ -690,7 +690,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6S',
'lat': u'035 51 20W',
'#fid': 17L,
'#geometry': 'POINT(-1.09183333 -35.85555556)',
'#geometry': 'Point (-1.09183333 -35.85555556)',
},
18L: {
'id': u'14',
@ -698,7 +698,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6+',
'lat': u'035 51 20+',
'#fid': 18L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
19L: {
'id': u'15',
@ -706,7 +706,7 @@ def test_015_read_dms_xy():
'lon': u'1 05 30.6-',
'lat': u'035 51 20-',
'#fid': 19L,
'#geometry': 'POINT(-1.09183333 -35.85555556)',
'#geometry': 'Point (-1.09183333 -35.85555556)',
},
21L: {
'id': u'16',
@ -714,7 +714,7 @@ def test_015_read_dms_xy():
'lon': u' 1 05 30.6',
'lat': u'035 51 20 ',
'#fid': 21L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
22L: {
'id': u'17',
@ -722,7 +722,7 @@ def test_015_read_dms_xy():
'lon': u' N 1 05 30.6',
'lat': u'035 51 20 E ',
'#fid': 22L,
'#geometry': 'POINT(1.09183333 35.85555556)',
'#geometry': 'Point (1.09183333 35.85555556)',
},
24L: {
'id': u'18',
@ -730,7 +730,7 @@ def test_015_read_dms_xy():
'lon': u'1d05m30.6s S',
'lat': u"35d51'20",
'#fid': 24L,
'#geometry': 'POINT(-1.09183333 35.85555556)',
'#geometry': 'Point (-1.09183333 35.85555556)',
},
25L: {
'id': u'19',
@ -738,7 +738,7 @@ def test_015_read_dms_xy():
'lon': u'1 05.23',
'lat': u'4 55.03',
'#fid': 25L,
'#geometry': 'POINT(1.08716667 4.91716667)',
'#geometry': 'Point (1.08716667 4.91716667)',
},
}
wanted['log']=[
@ -767,7 +767,7 @@ def test_016_decimal_point():
'other': u'30.0',
'text field': u'Field with , in it',
'#fid': 2L,
'#geometry': 'POINT(10.0 20.0)',
'#geometry': 'Point (10 20)',
},
3L: {
'id': u'2',
@ -777,7 +777,7 @@ def test_016_decimal_point():
'other': u'-38.55',
'text field': u'Plain text field',
'#fid': 3L,
'#geometry': 'POINT(12.0 25.003)',
'#geometry': 'Point (12 25.003)',
},
}
wanted['log']=[]
@ -964,7 +964,7 @@ def test_024_filter_rect_xy():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
10L: {
'id': u'9',
@ -972,7 +972,7 @@ def test_024_filter_rect_xy():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
1002L: {
'id': u'1',
@ -980,7 +980,7 @@ def test_024_filter_rect_xy():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
1010L: {
'id': u'9',
@ -988,7 +988,7 @@ def test_024_filter_rect_xy():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
}
wanted['log']=[
@ -1006,49 +1006,49 @@ def test_025_filter_rect_wkt():
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
4L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
5L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
6L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
7L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
1002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
1004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
1006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
}
wanted['log']=[
@ -1366,7 +1366,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
10L: {
'id': u'9',
@ -1374,7 +1374,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
1002L: {
'id': u'1',
@ -1382,7 +1382,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
1010L: {
'id': u'9',
@ -1390,7 +1390,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
3002L: {
'id': u'1',
@ -1398,7 +1398,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
3003L: {
'id': u'2',
@ -1406,7 +1406,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'5',
'y': u'35',
'#fid': 3L,
'#geometry': 'POINT(5.0 35.0)',
'#geometry': 'Point (5 35)',
},
3004L: {
'id': u'3',
@ -1414,7 +1414,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'5',
'y': u'55',
'#fid': 4L,
'#geometry': 'POINT(5.0 55.0)',
'#geometry': 'Point (5 55)',
},
3005L: {
'id': u'4',
@ -1422,7 +1422,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'55',
'#fid': 5L,
'#geometry': 'POINT(15.0 55.0)',
'#geometry': 'Point (15 55)',
},
3006L: {
'id': u'5',
@ -1430,7 +1430,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'55',
'#fid': 6L,
'#geometry': 'POINT(35.0 55.0)',
'#geometry': 'Point (35 55)',
},
3007L: {
'id': u'6',
@ -1438,7 +1438,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'45',
'#fid': 7L,
'#geometry': 'POINT(35.0 45.0)',
'#geometry': 'Point (35 45)',
},
3008L: {
'id': u'7',
@ -1446,7 +1446,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'25',
'#fid': 8L,
'#geometry': 'POINT(35.0 25.0)',
'#geometry': 'Point (35 25)',
},
3009L: {
'id': u'8',
@ -1454,7 +1454,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'25',
'#fid': 9L,
'#geometry': 'POINT(15.0 25.0)',
'#geometry': 'Point (15 25)',
},
3010L: {
'id': u'9',
@ -1462,7 +1462,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
4002L: {
'id': u'1',
@ -1470,7 +1470,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'35',
'#fid': 2L,
'#geometry': 'POINT(15.0 35.0)',
'#geometry': 'Point (15 35)',
},
4003L: {
'id': u'2',
@ -1478,7 +1478,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'5',
'y': u'35',
'#fid': 3L,
'#geometry': 'POINT(5.0 35.0)',
'#geometry': 'Point (5 35)',
},
4004L: {
'id': u'3',
@ -1486,7 +1486,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'5',
'y': u'55',
'#fid': 4L,
'#geometry': 'POINT(5.0 55.0)',
'#geometry': 'Point (5 55)',
},
4005L: {
'id': u'4',
@ -1494,7 +1494,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'55',
'#fid': 5L,
'#geometry': 'POINT(15.0 55.0)',
'#geometry': 'Point (15 55)',
},
4006L: {
'id': u'5',
@ -1502,7 +1502,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'55',
'#fid': 6L,
'#geometry': 'POINT(35.0 55.0)',
'#geometry': 'Point (35 55)',
},
4007L: {
'id': u'6',
@ -1510,7 +1510,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'45',
'#fid': 7L,
'#geometry': 'POINT(35.0 45.0)',
'#geometry': 'Point (35 45)',
},
4008L: {
'id': u'7',
@ -1518,7 +1518,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'35',
'y': u'25',
'#fid': 8L,
'#geometry': 'POINT(35.0 25.0)',
'#geometry': 'Point (35 25)',
},
4009L: {
'id': u'8',
@ -1526,7 +1526,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'15',
'y': u'25',
'#fid': 9L,
'#geometry': 'POINT(15.0 25.0)',
'#geometry': 'Point (15 25)',
},
4010L: {
'id': u'9',
@ -1534,7 +1534,7 @@ def test_030_filter_rect_xy_spatial_index():
'x': u'25',
'y': u'45',
'#fid': 10L,
'#geometry': 'POINT(25.0 45.0)',
'#geometry': 'Point (25 45)',
},
}
wanted['log']=[
@ -1552,121 +1552,121 @@ def test_031_filter_rect_wkt_spatial_index():
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
4L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
5L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
6L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
7L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
1002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
1004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
1006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
3002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
3003L: {
'id': u'2',
'description': u'Outside',
'#fid': 3L,
'#geometry': 'LINESTRING(0.0 0.0, 0.0 10.0)',
'#geometry': 'LineString (0 0, 0 10)',
},
3004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
3005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
3006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
3007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
4002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
4003L: {
'id': u'2',
'description': u'Outside',
'#fid': 3L,
'#geometry': 'LINESTRING(0.0 0.0, 0.0 10.0)',
'#geometry': 'LineString (0 0, 0 10)',
},
4004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
4005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
4006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
4007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
}
wanted['log']=[
@ -1684,187 +1684,187 @@ def test_032_filter_rect_wkt_create_spatial_index():
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
4L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
5L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
6L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
7L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
1002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
1003L: {
'id': u'2',
'description': u'Outside',
'#fid': 3L,
'#geometry': 'LINESTRING(0.0 0.0, 0.0 10.0)',
'#geometry': 'LineString (0 0, 0 10)',
},
1004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
1005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
1006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
1007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
3002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
3004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
3005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
3006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
3007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
4002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
4004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
4006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
6002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
6003L: {
'id': u'2',
'description': u'Outside',
'#fid': 3L,
'#geometry': 'LINESTRING(0.0 0.0, 0.0 10.0)',
'#geometry': 'LineString (0 0, 0 10)',
},
6004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
6005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
6006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
6007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
7002L: {
'id': u'1',
'description': u'Inside',
'#fid': 2L,
'#geometry': 'LINESTRING(12.0 32.0, 28.0 48.0)',
'#geometry': 'LineString (12 32, 28 48)',
},
7003L: {
'id': u'2',
'description': u'Outside',
'#fid': 3L,
'#geometry': 'LINESTRING(0.0 0.0, 0.0 10.0)',
'#geometry': 'LineString (0 0, 0 10)',
},
7004L: {
'id': u'3',
'description': u'Crossing',
'#fid': 4L,
'#geometry': 'LINESTRING(5.0 30.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 30 55)',
},
7005L: {
'id': u'4',
'description': u'Bounding box overlap',
'#fid': 5L,
'#geometry': 'LINESTRING(5.0 30.0, 5.0 55.0, 30.0 55.0)',
'#geometry': 'LineString (5 30, 5 55, 30 55)',
},
7006L: {
'id': u'5',
'description': u'Crossing 2',
'#fid': 6L,
'#geometry': 'LINESTRING(25.0 35.0, 35.0 35.0)',
'#geometry': 'LineString (25 35, 35 35)',
},
7007L: {
'id': u'6',
'description': u'Bounding box overlap 2',
'#fid': 7L,
'#geometry': 'LINESTRING(28.0 29.0, 31.0 29.0, 31.0 33.0)',
'#geometry': 'LineString (28 29, 31 29, 31 33)',
},
}
wanted['log']=[
@ -2192,7 +2192,7 @@ def test_038_type_inference():
'real': u'NULL',
'text2': u'1',
'#fid': 2L,
'#geometry': 'POINT(1 1)',
'#geometry': 'Point (1 1)',
},
3L: {
'id': u'line2',
@ -2206,7 +2206,7 @@ def test_038_type_inference():
'real': u'1.3',
'text2': u'-4',
'#fid': 3L,
'#geometry': 'POINT(1 5)',
'#geometry': 'Point (1 5)',
},
4L: {
'id': u'line3',
@ -2220,7 +2220,7 @@ def test_038_type_inference():
'real': u'2.0',
'text2': u'1x',
'#fid': 4L,
'#geometry': 'POINT(5 5)',
'#geometry': 'Point (5 5)',
},
5L: {
'id': u'line4',
@ -2234,7 +2234,7 @@ def test_038_type_inference():
'real': u'-123.56',
'text2': u'NULL',
'#fid': 5L,
'#geometry': 'POINT(5 1)',
'#geometry': 'Point (5 1)',
},
6L: {
'id': u'line5',
@ -2248,7 +2248,7 @@ def test_038_type_inference():
'real': u'0.00023',
'text2': u'23',
'#fid': 6L,
'#geometry': 'POINT(3 1)',
'#geometry': 'Point (3 1)',
},
7L: {
'id': u'line6',
@ -2262,7 +2262,7 @@ def test_038_type_inference():
'real': u'99.0',
'text2': u'0',
'#fid': 7L,
'#geometry': 'POINT(1 3)',
'#geometry': 'Point (1 3)',
},
}
wanted['log']=[]

View File

@ -1,6 +1,6 @@
id|description|geom_wkt
1|Point wkt|POINT(10 20)
2|Multipoint wkt|MULTIPOINT(10 20,11 21)
2|Multipoint wkt|MULTIPOINT((10 20),(11 21))
3|Linestring wkt|LINESTRING(10 20,11 21)
4|Multiline string wkt|MULTILINESTRING((10 20,11 21),(20 30,21 31))
5|Polygon wkt|POLYGON((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,14 14))

1 id description geom_wkt
2 1 Point wkt POINT(10 20)
3 2 Multipoint wkt MULTIPOINT(10 20,11 21) MULTIPOINT((10 20),(11 21))
4 3 Linestring wkt LINESTRING(10 20,11 21)
5 4 Multiline string wkt MULTILINESTRING((10 20,11 21),(20 30,21 31))
6 5 Polygon wkt POLYGON((10 10,10 20,20 20,20 10,10 10),(14 14,14 16,16 16,14 14))