add a big group of csv test cases

This commit is contained in:
Dane Springmeyer 2011-10-18 18:19:32 -07:00
parent a1e73ad1c6
commit 016527549c
20 changed files with 69 additions and 1 deletions

View file

@ -0,0 +1,9 @@
x,y,name
0,0,a
0,0,b
1 x y name
2 0 0 a
3 0 0 b

View file

@ -0,0 +1,5 @@
x,y,text,date,integer,boolean,float,time,datetime,empty_column
0,0,a b,1971-01-01,40,True,1.0,04:14:00,1971-01-01T04:14:00,
0,0,c d,1948-01-01,63,True,1.27,14:57:13,1948-01-01T14:57:13,
0,0,e f,1920-01-01,164,False,41800000.01,00:00:00,1920-01-01T00:00:00,
0,0,This row has empties,,,,,,,
1 x y text date integer boolean float time datetime empty_column
2 0 0 a b 1971-01-01 40 True 1.0 04:14:00 1971-01-01T04:14:00
3 0 0 c d 1948-01-01 63 True 1.27 14:57:13 1948-01-01T14:57:13
4 0 0 e f 1920-01-01 164 False 41800000.01 00:00:00 1920-01-01T00:00:00
5 0 0 This row has empties

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,3 @@
x,y,z
-122a,48b,bogus
-122,48,fine
1 x y z
2 -122a 48b bogus
3 -122 48 fine

View file

@ -0,0 +1,2 @@
wkt,name
"POINT (a b)",one
1 wkt name
2 POINT (a b) one

View file

@ -0,0 +1,2 @@
x y name
-122, 48, hello
1 x y name
2 -122, 48, hello

View file

@ -0,0 +1,2 @@
a,b,c,d,e,f,g
1,2,3,4,5,6,7
1 a b c d e f g
2 1 2 3 4 5 6 7

View file

@ -0,0 +1 @@
-122,48,place
1 -122 48 place

View file

@ -0,0 +1,4 @@
x,y,name
0,0,a/a
1,4,b/b
10,2.5,c/c
1 x y name
2 0 0 a/a
3 1 4 b/b
4 10 2.5 c/c

View file

@ -0,0 +1 @@
x,y,z 1,10,0
1 x y z 1 10 0

3
tests/data/csv/tabs.tsv Normal file
View file

@ -0,0 +1,3 @@
x y name
-122 48 hello
0 0 "null island"
1 x y name
2 -122 48 hello
3 0 0 null island

View file

@ -0,0 +1,2 @@
x, y,z
-122 , 48,0
1 x y z
2 -122 48 0

View file

@ -0,0 +1,11 @@
geonameid name asciiname alternatenames latitude longitude feature_class feature_code country_code cc2 admin1 admin2 admin3 admin4 population elevation gtopo3 timezone mod_date
725712 Vratsa Vratsa Vraca,Vratca,Vratsa,Vrattsa,Vratza,Wraza,Враца 43.21 23.5625 P PPLA BG 64 VRC10 64941 341 Europe/Sofia 2011-10-10
725816 Sveti Vlas Sveti Vlas Manasturkioy,Manastŭrkioy,Monasturkioy,Monastŭrkioy,Saint Vlas,Sveti Vlas,Sveti-Vlas,Sweti Wlas,Vlas,Влас,Свети-Влас 42.7136 27.75867 P PPL BG BG 39 BGS15 BGS15-02 3875 50 -9999 Europe/Sofia 2010-03-07
725905 Vidin Vidin Vidin,Vidine,Widin,wydyn,Видин,ویدین 43.99 22.8725 P PPLA BG 63 VID09 54409 35 Europe/Sofia 2011-10-10
725924 Vetrino Vetrino Asya-Tepe,Jasi Tepe,Vetrino,Vyetreno,Vyetrino,Wetrino,Yasa-Tepe,Yase-Tepe,Yasu-Tepe,Yasă-Tepe,Yasŭ-Tepe,Ветрино 43.31667 27.43333 P PPL BG BG 61 VAR08 1368 223 Europe/Sofia 2011-10-10
725935 Vetovo Vetovo Vetova,Vetovo,Vjetevo,Vyetovo,Wetowo,Ветово 43.7 26.26667 P PPL BG 53 RSE05 5175 184 Europe/Sofia 2007-04-05
725967 Venets Venets K'okledzha,K'oklyudzha,K'okyudzha,Kiokhudza,Kiokhudža,Kokedzha,Kokledzha,Koklyudzha,Kokyudzha,Venec,Venets,Vyenets,Wenez,Венец 43.55 26.93333 P PPL BG BG 54 SHU07 1450 334 Europe/Sofia 2011-10-10
725988 Velingrad Velingrad Velingrad,Велинград 42.02724 23.99569 P PPL BG 48 PAZ08 24036 745 Europe/Sofia 2010-05-28
725993 Veliko Tŭrnovo Veliko Turnovo Tarnovo,Tarnowo,Ternovo,Tirnovo,Trnova,Trnovo,Turnovo,Tărnovo,Tărnowo,Tŭrnovo,Veliko T\"rnovo,Veliko Tarnovo,Veliko Tărnovo,Weliko Tarnowo,Weliko Tyrnowo,vu~erikotarunovu~o,Велико Търново,ヴェリコタルノヴォ 43.08124 25.62904 P PPLA BG 62 VTR04 66217 162 Europe/Sofia 2007-07-01
726050 Varna Varna Barna,Odessos,Odessus,Stalin,Varna,Warna,farna,varna,vu~aruna,wa er na,wrnh,Βάρνα,Варна,ורנה,فارنا,ვარნა,ヴァルナ,瓦爾納 43.21667 27.91667 P PPLA BG 61 VAR06 312770 95 Europe/Sofia 2011-10-10
726114 Ugŭrchin Ugurchin Ugarchin,Ugarcin,Ugartschin,Ugarčin,Ugirkin,Ugrchin,Ugrcin,Ugrčin,Ugurchin,Ugurcin,Ugürčin,Ugărchin,Ugărtschin,Угърчин 43.1 24.41667 P PPL BG 46 LOV36 2965 298 Europe/Sofia 2007-04-05
Can't render this file because it contains an unexpected character in line 9 and column 129.

View file

View file

@ -0,0 +1,3 @@
x,y,z
-122a,48b,bogus
-122,48,fine
1 x y z
2 -122a 48b bogus
3 -122 48 fine

View file

@ -0,0 +1,2 @@
x,y,z
0,0,0
1 x y z
2 0 0 0

9
tests/data/csv/wkt.csv Normal file
View file

@ -0,0 +1,9 @@
type,WKT
point, "POINT (30 10)"
linestring, "LINESTRING (30 10, 10 30, 40 40)"
polygon, "POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))"
polygon, "POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30))"
multipoint, "MULTIPOINT ((10 40), (40 30), (20 20), (30 10))"
multilinestring, "MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))"
multipolygon, "MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))"
multipolygon, "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 45 20, 30 5, 10 10, 10 30, 20 35),(30 20, 20 25, 20 15, 30 20)))"
1 type WKT
2 point POINT (30 10)
3 linestring LINESTRING (30 10, 10 30, 40 40)
4 polygon POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10))
5 polygon POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30))
6 multipoint MULTIPOINT ((10 40), (40 30), (20 20), (30 10))
7 multilinestring MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))
8 multipolygon MULTIPOLYGON (((30 20, 10 40, 45 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))
9 multipolygon MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 45 20, 30 5, 10 10, 10 30, 20 35),(30 20, 20 25, 20 15, 30 20)))

View file

@ -22,7 +22,7 @@
<Layer name="point" srs="+init=epsg:4326">
<StyleName>1</StyleName>
<Datasource>
<Parameter name="file">../csv/points.vrt</Parameter>
<Parameter name="file">../vrt/points.vrt</Parameter>
<Parameter name="layer_by_index">0</Parameter>
<Parameter name="type">ogr</Parameter>
</Datasource>

View file

@ -0,0 +1,8 @@
<OGRVRTDataSource>
<OGRVRTLayer name="points">
<SrcDataSource relativeToVRT="1">../csv/points.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="x" y="y"/>
</OGRVRTLayer>
</OGRVRTDataSource>