Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
producers=gdf_poly_gen,
consumers=gdf_poly_houses,
method="boundary", # select the method of how to connect the buildings
welding=True,
simplify=True,
)

# plot output after processing the geometry
Expand Down
10 changes: 4 additions & 6 deletions src/dhnx/gistools/connect_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def process_geometry(
reset_index=True,
n_conn=1,
n_conn_prod=1,
welding=True,
simplify=True,
):
"""
This function connects the consumers and producers to the line network,
Expand Down Expand Up @@ -621,7 +621,8 @@ def process_geometry(
check_geometry_type(lines, types=["LineString", "MultiLineString"])
for gdf in [producers, consumers, producers_poly, consumers_poly]:
check_geometry_type(
gdf, types=["Polygon", "Point", "MultiPolygon", "MultiPoint"])
gdf, types=["Polygon", "Point", "MultiPolygon", "MultiPoint"]
)
check_duplicate_geometries(gdf)

# split multilinestrings to single lines with only 1 starting
Expand Down Expand Up @@ -675,9 +676,6 @@ def process_geometry(
producers_poly, producers, lines_producers
)

# Keep only the shortest of all lines connecting the same two points
lines = go.drop_parallel_lines(lines)

# add additional line identifier
lines_producers["type"] = "GL" # GL for generation line
lines["type"] = "DL" # DL for distribution line
Expand Down Expand Up @@ -716,7 +714,7 @@ def process_geometry(
# Convert all MultiLineStrings to LineStrings
check_geometry_type(lines_all, types=["LineString"])

if welding:
if simplify:
lines_all = go.simplify(lines_all)
remaining_forks = set(lines_all["from_node"]) | set(
lines_all["to_node"]
Expand Down
Loading
Loading