Skip to content

Commit

Permalink
Merge branch 'dev' into features/multiple_building_connections
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Jan 24, 2025
2 parents 44bf390 + 62e6b61 commit 7465b62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dhnx/optimization/precalc_hydraulic.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def delta_p(v, d_i, k=0.1, T_medium=90, length=1,
Returns
-------
Pressure drop [bar] : numeric
Pressure drop [Pa] : numeric
"""
k = k * 0.001
Expand Down
8 changes: 2 additions & 6 deletions examples/optimisation/import_osm_invest/import_osm_invest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,13 @@
graph = ox.graph_from_polygon(polygon, network_type='drive_service')
ox.plot_graph(graph)

gdf_poly_houses = ox.geometries_from_polygon(polygon, tags=buildings)
gdf_lines_streets = ox.geometries_from_polygon(polygon, tags=streets)
gdf_poly_houses = ox.features_from_polygon(polygon, tags=buildings)
gdf_lines_streets = ox.features_from_polygon(polygon, tags=streets)

# Make sure that only polygon geometries are used
gdf_poly_houses = gdf_poly_houses[gdf_poly_houses['geometry'].apply(
lambda x: isinstance(x, geometry.Polygon))]

# Remove nodes column (that make somehow trouble for exporting .geojson)
gdf_poly_houses.drop(columns=['nodes'], inplace=True)
gdf_lines_streets.drop(columns=['nodes'], inplace=True)

# We need one (or more) buildings that we call "generators".
# Choose one among the buildings at random and move it to a new GeoDataFrame
np.random.seed(42)
Expand Down

0 comments on commit 7465b62

Please sign in to comment.