Skip to content

Commit

Permalink
fix use of old form attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
KasiaKoz committed Dec 18, 2023
1 parent f15cc75 commit 3c07f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions genet/output/geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ def generate_standard_outputs(
logging.warning(f"Your network is missing a vital attribute {attribute}")

logging.info("Generating geojson outputs for different highway tags in car modal subgraph")
highway_tags = n.link_attribute_data_under_key({"attributes": {"osm:way:highway": "text"}})
highway_tags = n.link_attribute_data_under_key({"attributes": "osm:way:highway"})
highway_tags = set(chain.from_iterable(highway_tags.apply(lambda x: persistence.setify(x))))
for tag in highway_tags:
tag_links = n.extract_links_on_edge_attributes(
conditions={"attributes": {"osm:way:highway": {"text": tag}}}, mixed_dtypes=True
conditions={"attributes": {"osm:way:highway": tag}}, mixed_dtypes=True
)
save_geodataframe(
graph_links[graph_links["id"].isin(tag_links)],
Expand Down
8 changes: 1 addition & 7 deletions tests/test_output_geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ def network(correct_schedule):
attribs={
"length": 123,
"modes": ["bike"],
"attributes": {
"osm:way:highway": {
"name": "osm:way:highway",
"class": "java.lang.String",
"text": "unclassified",
}
},
"attributes": {"osm:way:highway": {"unclassified"}},
},
)
n.add_link("link_2", "1", "0", attribs={"length": 123, "modes": ["rail"]})
Expand Down

0 comments on commit 3c07f67

Please sign in to comment.