Skip to content

Commit

Permalink
fixes CRS on dual nodes gdf
Browse files Browse the repository at this point in the history
  • Loading branch information
songololo committed Apr 23, 2024
1 parent 5b4628c commit b83d97f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cityseer"
version = '4.13.0'
version = '4.13.1'
description = "Computational tools for network-based pedestrian-scale urban analysis"
readme = "README.md"
requires-python = ">=3.10, <3.13"
Expand Down
1 change: 1 addition & 0 deletions pysrc/cityseer/tools/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ def network_structure_from_nx(
edges_gdf["primal_node_id"] = agg_edge_dual_data
nodes_gdf: gpd.GeoDataFrame = nodes_gdf.join(nodes_dual_gdf) # type: ignore
nodes_gdf.set_geometry("primal_edge", inplace=True)
nodes_gdf.set_crs(crs, inplace=True)
nodes_gdf["dual_node"] = nodes_gdf["geom"].to_wkt() # type: ignore
nodes_gdf.drop(columns=["geom"], inplace=True)

Expand Down
2 changes: 2 additions & 0 deletions tests/tools/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def test_network_structure_from_nx(diamond_graph):
assert len(nodes_gdf) == (network_structure.node_count()) == G.number_of_nodes()
# edges = x2
assert network_structure.edge_count == G.number_of_edges() * 2
# CRS check
assert nodes_gdf.crs.to_epsg() == 3395
# dual specific checks
if is_dual is True:
# check that primal geom is copied across
Expand Down

0 comments on commit b83d97f

Please sign in to comment.