11
11
)
12
12
13
13
_FILENAMES = {
14
- "12103-0400 .zip" : {
15
- "count" : 3371 ,
14
+ "14103-0200 .zip" : {
15
+ "count" : 446 ,
16
16
},
17
17
"15222-1107-1553.xml" : {
18
18
"count" : 1051 ,
23
23
}
24
24
25
25
26
- def test_process ():
26
+ def test_process (tmp_path ):
27
27
"""Run process"""
28
28
for filename in _FILENAMES :
29
29
src_path = Path ("testdata" ) / filename
30
- dst_path = src_path .with_suffix (".geojson" )
30
+ dst_path = ( tmp_path / src_path . stem ) .with_suffix (".geojson" )
31
31
options = ParseOptions ()
32
32
executor = ProcessPoolExecutor (options )
33
33
files_to_ogr_file ([src_path ], dst_path , executor )
34
34
35
35
36
- def test_executors ():
36
+ def test_executors (tmp_path ):
37
37
"""Test several executors"""
38
38
for executor_cls in [ThreadPoolExecutor , SingleThreadExecutor ]:
39
39
src_path = Path ("testdata" ) / "15222-1107-1553.xml"
40
- dst_path = src_path .with_suffix (".geojson" )
40
+ dst_path = ( tmp_path / src_path . stem ) .with_suffix (".geojson" )
41
41
options = ParseOptions ()
42
42
executor = executor_cls (options )
43
43
files_to_ogr_file ([src_path ], dst_path , executor )
@@ -56,22 +56,22 @@ def test_iter_features():
56
56
assert count == props ["count" ]
57
57
58
58
59
- def test_iter_features_arbitrary ():
59
+ def test_iter_features_arbitrary_crs ():
60
60
"""Test iter_features with the arbitrary option"""
61
- filename = "12103-0400 .zip"
61
+ filename = "14103-0200 .zip"
62
62
src_path = Path ("testdata" ) / filename
63
63
64
64
options = ParseOptions (include_arbitrary_crs = True )
65
65
executor = ProcessPoolExecutor (options )
66
66
count = 0
67
67
for _ in files_to_feature_iter ([src_path ], executor ):
68
68
count += 1
69
- assert count == 71073
69
+ assert count == 27237
70
70
71
71
72
72
def test_iter_features_chikugai ():
73
73
"""Test iter_features with the chikugai option"""
74
- filename = "12103-0400 .zip"
74
+ filename = "14103-0200 .zip"
75
75
src_path = Path ("testdata" ) / filename
76
76
77
77
options = ParseOptions (include_chikugai = True , include_arbitrary_crs = True )
@@ -83,5 +83,5 @@ def test_iter_features_chikugai():
83
83
chiban = str (feature ["properties" ]["地番" ])
84
84
if "地区外" in chiban or "別図" in chiban :
85
85
found_chikugai = True
86
- assert count == 71103
86
+ assert count == 27247
87
87
assert found_chikugai
0 commit comments