simonscheider / mapmatching

An arcpy based HMM map matching tool
MIT License
131 stars 53 forks source link

AttributeError: 'Graph' object has no attribute 'edges_iter' #2

Closed aminKMT closed 6 years ago

aminKMT commented 6 years ago

Hi! I'm using mapmatcher python code, but when I run it with both my data and test data it gives me the attribute error (AttributeError: 'Graph' object has no attribute 'edges_iter'). I updated my networkx by pip install, but it still did not work and I got the same error. could you please let me know how I can solve it. Thanks, In the following you can see what I got in python:

track size:14 Number of segments: 745 C:\Users\amin.keramati\Desktop\tPRROMTO2\AminShp\testSegments.shp graph size (excluding unconnected parts): 573

Traceback (most recent call last): File "C:\Users\amin.keramati\Desktop\tPRROMTO2\mapmatcher\mapmatcher11.py", line 510, in opt = mapMatch(trackname, roadname, 20, 10, 50) File "C:\Users\amin.keramati\Desktop\tPRROMTO2\mapmatcher\mapmatcher11.py", line 87, in mapMatch graph = getNetworkGraph(segments,lengths) File "C:\Users\amin.keramati\Desktop\tPRROMTO2\mapmatcher\mapmatcher11.py", line 469, in getNetworkGraph for n0, n1 in sg.edges_iter(): AttributeError: 'Graph' object has no attribute 'edges_iter'

simonscheider commented 6 years ago

This needs to be adjusted to the new networkx 2.0 version (changing edges_iter() method into edges() method)

simonscheider commented 6 years ago

I corrected the networkx errors, to account for the new version networkx 2.0

aminKMT commented 6 years ago

Dear Dr. Simon,

Thanks a lot to update me,

Regards,

Amin,

On Tue, Feb 20, 2018 at 8:23 AM, simonscheider notifications@github.com wrote:

Closed #2 https://github.com/simonscheider/mapmatching/issues/2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonscheider/mapmatching/issues/2#event-1482511955, or mute the thread https://github.com/notifications/unsubscribe-auth/AhT0fJfYogzkL-pf5jDjgHahvtPzG6ZTks5tWtVvgaJpZM4ROyiv .