Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 2097b82

Browse files
committed
test: multiple geom passing in FeatureCollection
1 parent ce3496e commit 2097b82

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_splitter.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def test_init_splitter_types(aoi_json):
4646
# GeoJSON Dict Polygon
4747
polygon = feature.get("geometry")
4848
FMTMSplitter(polygon)
49+
# FeatureCollection multiple geoms (4 polygons)
50+
splitter = FMTMSplitter("tests/testdata/kathmandu_split.geojson")
51+
assert len(splitter.aoi) == 4
4952

5053

5154
def test_split_by_square_with_str(aoi_json):
@@ -104,6 +107,19 @@ def test_split_by_sql_fmtm(aoi_json, extract_json, output_json):
104107
assert sorted(features) == sorted(output_json)
105108

106109

110+
def test_split_by_sql_fmtm_multi_geom(aoi_json, extract_json, output_json):
111+
"""Test divide by square from geojson file with multiple geometries."""
112+
with open("tests/testdata/kathmandu_split.geojson", "r") as jsonfile:
113+
parsed_featcol = geojson.load(jsonfile)
114+
features = split_by_sql(
115+
parsed_featcol,
116+
"postgresql://fmtm:dummycipassword@db:5432/splitter",
117+
num_buildings=10,
118+
osm_extract=extract_json,
119+
)
120+
assert len(features.get("features")) == 11
121+
122+
107123
def test_cli_help(capsys):
108124
"""Check help text displays on CLI."""
109125
try:

0 commit comments

Comments
 (0)