Skip to content

Tracking attributes of changed edges after neatify #261

@gsagostini

Description

@gsagostini

As discussed in #6 . Some edges with changed status after a neatify loop will not inherit any attribute. Is this expected? Using neatnet 0.1.2

import osmnx as ox
import neatnet

#Collect a graph via osmnx and convert to a GeoDataFrame with a single attribute:
G = ox.graph_from_bbox((-73.86, 40.73,-73.85, 40.74))
Gedges = ox.convert.graph_to_gdfs(G, nodes=False)[['geometry']].reset_index(drop=True).to_crs('EPSG:3857')
Gedges['attribute'] = Gedges.index.astype(int)

#Neatify:
neatified_edges = neatnet.neatify(Gedges)

#There are edges labeled "changed" which do not receive an attribute:
bug_changed = (neatified_edges._status == 'changed')&(neatified_edges.attribute.isna())
print(bug_changed.sum())

This prints 1 for bug_changed.sum() i.e. there is an edge whose status is _changed which does not inherit the attribute from any parent edge. This is happening, both in this example and in others, around bridges or overpasses.

I cannot yet produce an example where the new edge receives an attribute from basic geometries or from an osmnx graph, but this is happening to me on a much larger graph. Will continue to look for an example and update, but figured this issue could be helpful to look at already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions