Bug report #9174

QGIS crashes when calculating Shortest Path (Road Graph) with attached shapefile

Added by Jonas Ohlund over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:High
Assignee:-
Category:C++ Plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:17804

Description

New description:

with the attached shape "vagkartan_sv.zip" the road graph plugin crashes QGIS (tested on multiple platforms, and qgis 2.0/master).

The shape afer being cleaned with GRASS works as expected.


Old description:

Hello GIS-Pros,

I really need your help!

I'm a real newbie so please forgive me if this is a stupid post but I couldn't find a solution anywhere. I'm studying Urban and Regional planning at Stockholm University and right now we're doing this GIS project. The university uses ArcGis to train us but since I would like to be able to improve my skills at home on a mac, QGIS sounded like the perfect solution. Most of our teachers really promotes QGIS as a good alternative and we're allowed to use it for this project as long as we can make it work. After going through the pretty advanced installation process with some errors regarding the version of R which I sorted out eventually, I was thrilled to see QGIS working and I was feeling good about this project since I now would be able to do it on my own computer. So far, so good..

For this project we need to calculate shortest path and other basic network analysis stuff and we're using geodata from Swedish government institutions (shapefiles). I'm loading a vector data shapefile with roads for a certain area into QGIS. Then I go 'Vector' > 'Road Graph' > 'Settings' and select the current layer, then 'ok'. Using 'Shortest Path' I select 'start' and 'stop' on the road net and hit 'calculate' and then QGIS quits unexpectedly. Every single time!

I've tried everything I can think of:
- Different settings in Road Graph.
- Adding a speed field to the layer attribute date.
- Reinstalling QGIS and all the requirements from (http://www.kyngchaos.com/software/qgis) several times.
- Installing QGIS on another mac to se if there's something wrong with mine - still quits..
- Creating a new empty project, drawing a single line and run shortest path again (to rule out that there is something wrong with the shapefile I got from the swedish government.

Nothing seems to work and I can't find anybody online with the same problem (Shortest Path hangs QGIS). You guys are my last hope. And I need to get going really fast with this project that is due to be handed in before Xmas. If I cant sort this out during the weekend I'll have to install parallels and run ArcGIS or use ArcGIS at school.

I must have missed something right? Something really simple? Three different crash reports are attached. Please help me!

Many many thanks in advance! Contact me at: if you need further information to help me solve this.

Kind regards,
Jonas Öhlund
Stockholm University
Department of Human Geography

roadgraph_crash_1.rtf (79.4 KB) Jonas Ohlund, 2013-12-07 07:45 PM

roadgraph_crash_2.rtf (76.3 KB) Jonas Ohlund, 2013-12-07 07:45 PM

roadgraph_crash_3.rtf (76.3 KB) Jonas Ohlund, 2013-12-07 07:45 PM

vagkartan_sv.zip (14.7 KB) Jonas Ohlund, 2013-12-08 04:09 AM

strace.zip (836 KB) Richard Duivenvoorde, 2013-12-08 05:26 AM

clean.tar.gz (9.95 KB) Giovanni Manghi, 2013-12-08 08:19 AM

v_clean_crashlog1.rtf (2.66 KB) Jonas Ohlund, 2013-12-08 11:47 AM

32.png (276 KB) Giovanni Manghi, 2013-12-09 03:45 AM


Related issues

Related to QGIS Application - Feature request #9180: Shortest Path (Road Graph) plugin cannot handle 2.5D sha... Closed 2013-12-09

Associated revisions

Revision 758f5e5d
Added by Matthias Kuhn over 10 years ago

Road graph plugin: don't crash with 25D input layers
Fix #9174

History

#1 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Feedback

it does not seems to crash while testing under Linux and Windows. Se please:

) test on another platform and/or mac to try find if is a local issue or a platform issue
) attach here a sample of your data, so we can test if the issue is data-dependent

#2 Updated by Richard Duivenvoorde over 10 years ago

Yep, here on debian too: both 2.01 and master are working fine.

@jonas I'll sent you zip file with some dutch roads (epsg:28992) which 'just works' on linux.

if you still encounter problems, I think it is either a mac-packaging problem, or a mac-python problem.

please let us know, so we can assign this problem to somebody developing/packaging for macs (these are thin though) then.

Fastest bet I think is either parallels and install ubuntu or debian, or windows.
Another options maybe: find a intel machine and use the osgeo4w live cd with qgis on it: http://live.osgeo.org/en/index.htm?

#3 Updated by Jonas Ohlund over 10 years ago

Hi again,

Many thanks for your quick assistance! It worked with Richards dutch shape file which brings me some hope in solving this problem. But how to work around the issue and what's the real problem? For this project we have to use a big number of shapefiles from the swedish government (the same ones that are not working for me). Any idea what I'm doing wrong or how to work around it?

I've attached a simple road shape file thats not working for me. (epsg: 3006)

You made my day!
Thanks,
Jonas

#4 Updated by Richard Duivenvoorde over 10 years ago

Crash confirmed here. Attached shp files crash both 2.0 and current master on Linux.

Running QGIS via strace and output attached. Hope this is helpfull.

#5 Updated by Giovanni Manghi over 10 years ago

Jonas Ohlund wrote:

Hi again,

Many thanks for your quick assistance! It worked with Richards dutch shape file which brings me some hope in solving this problem. But how to work around the issue and what's the real problem? For this project we have to use a big number of shapefiles from the swedish government (the same ones that are not working for me). Any idea what I'm doing wrong or how to work around it?

I've attached a simple road shape file thats not working for me. (epsg: 3006)

yeah, with your data the tool crashes qgis, anyway it seems it something data related. I attached a copy of your data after a pass with GRASS v.clean (using th processing toolbox) tool and then it works without issues.

#6 Updated by Richard Duivenvoorde over 10 years ago

yep, confirmed here. The v.cleaned data works.

Thinking it was a data related issue, I already tried to resave the shape via QGIS this morning, and later also removing all columns from the dbf. That did NOT do the trick.

I see that the attribue 'KATEGORI' in t2.shp does NOT show strange characters anymore (while the original did).

Anyway. I think QGIS should not crash, even not from corrupted data.

@jonas so a workaround would be to cleanup all your shapes....

#7 Updated by Jonas Ohlund over 10 years ago

I'm amazed with all your knowledge and grateful for your help. Internet is sure revolutionary in many ways!

@Giovanni: yes, running shortest path with the cleaned files you attached worked so it feels like I'm getting closer to actually being able to use QGIS instead of ArcGIS. Unfortunately I wasn't able to clean files myself using Grass v.clean and just like @Richards gutfeeling indicated, there seams to be some kind of mac/python problem since GRASS v.clean crashed as well. Any idea what I could be doing wrong? I just ran the v.clean on the same files I sent you without changing any settings in the toolbox.. (See attached crash log)

Like you said it seems to be data related, but the same files works fantastic with ArcGIS and this is the only data source I can use for the project so Im still stuck here with a ticking clock. I haven't really understood what it takes to get a developer to look at this and what the time perspective on solving this is? What can I do to speed it up?

Two more questions:
1. Do you guys have any thoughts on the installation process in OS X? Do you think I would get better stability if I installed the whole Xcode package (getting python and all the dependencies right)? Like I said I followed the instructions at Kyngchaos.com and got some errors, is there anything I could have missed there?
2. Right now I'm still putting all my hopes in finding a solution with your help or at least find a way to make v.clean work like @Giovanni did. But plan B would be to explore if osgeo4w live cd could boot from USB? (I have an SSD drive in my OptiBay..) @Richard you wrote that I osgeo4w required Intel, my mac is intel based, could that work?

Again, thank you big time for your time and commitment!

Kindly,
Jonas

#8 Updated by Jonas Ohlund over 10 years ago

@Richard Im pretty sure the data isnt corrupt. Same shapes works fine with ArcGIS at school. Could the "strange characters " be swedish letters åäö? But why shouldnt python be able to handle that?

Thanks again everone! All further help in solving this is much appricated! (See my last post with a new crash log)

/Jonas

#9 Updated by Giovanni Manghi over 10 years ago

Jonas Ohlund wrote:

@Richard Im pretty sure the data isnt corrupt.

the data is not corrupt, but it can have geometry issues that are not handled correctly by the road graph tool (that is not python).

Same shapes works fine with ArcGIS at school.

it happens, and it happens also vice-versa. Now we have data that is not handled correctly by the tool we can open a detailed report and allow a dev fix it.

Thanks again everone! All further help in solving this is much appricated! (See my last post with a new crash log)

The workaround as already said is to give your data a pass with v.clean using the processing toolbox.

The python error you attached here shows when launching v.clean? do you have non ascii chars in the path of your input data?

#10 Updated by Giovanni Manghi over 10 years ago

@Giovanni: yes, running shortest path with the cleaned files you attached worked so it feels like I'm getting closer to actually being able to use QGIS instead of ArcGIS. Unfortunately I wasn't able to clean files myself using Grass v.clean and just like

see the attached screenshot to see the options I used

Like you said it seems to be data related, but the same files works fantastic with ArcGIS

as I said in the other answers, it happens, but also happens the other way.

What can I do to speed it up?

hire a developer, make a contribution, study the code and submit a patch

Two more questions:
1. Do you guys have any thoughts on the installation process in OS X?

sorry, I don't do Apple.

2. Right now I'm still putting all my hopes in finding a solution with your help or at least find a way to make v.clean work like @Giovanni did. But plan B would be to explore if osgeo4w live cd could boot from USB? (I have an SSD drive in my OptiBay..) @Richard you wrote that I osgeo4w required Intel, my mac is intel based, could that work?

The faster way to have a working copy of QGIS in another platform is using a Linux Virtual Machine or a live cd/usb.

#11 Updated by Matthias Kuhn over 10 years ago

Jonas, I just had a look at your latest log (v_clean)

I hope you are not afraid of a short test involving the edit of a source file.

If you could open the file /Users/Jonas/.qgis2/python/plugins/processing/outputs/Output.py and replace any occurrence of str( with unicode( and see if that solves the issue or just part of it, we could probably create a fix for this (secondary) issue.

#12 Updated by Jonas Ohlund over 10 years ago

  • % Done changed from 30 to 50

v.clean now works after using Giovanni's settings (I used break instead of snap before) and moving the data out of a directory containing the letter "ä". So I now have a working work-around.

Im now officially using QGIS for this project thanks to you guys!

I'm setting the status to 50% done but leaving the tread open so that issues like this can be sorted out making QGIS a competitive alternative to ArcGIS for "normal" users not prepared to go through a weekend of troubleshooting including (mailinglists, forums, and even mIRC to find a solution)

Thanks again everybody!

Kindly,
Jonas Öhlund

#13 Updated by Giovanni Manghi over 10 years ago

  • Operating System deleted (Mac )
  • OS version deleted (OS X 10.8.5)
  • Affected QGIS version changed from 2.0.1 to master
  • Subject changed from QGIS always crashes when calculating Shortest Path (Road Graph) to QGIS crashes when calculating Shortest Path (Road Graph) with attached shapefile
  • Assignee deleted (Jonas Ohlund)

#14 Updated by Giovanni Manghi over 10 years ago

  • % Done changed from 50 to 0

#15 Updated by Matthias Kuhn over 10 years ago

  • Status changed from Feedback to Closed

#16 Updated by Matthias Kuhn over 10 years ago

Reasoning: 2.5D layers are not supported by the plugin, but still available as source layers in the settings. This fix makes them unavailable (and inserts an additional security check) for routing so basically fixing the crash.

For now please use a tool which flattens the layer to 2D (like v.clean) to work with it.

Richard opened the feature request #9180 for 2.5D input layer support.

Also available in: Atom PDF