Bug report #12506

Crash adding delimited text layer

Added by norris lam over 9 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/Delimited Text
Affected QGIS version:2.8.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:20652

Description

Hello,

Qgis Desktop 2.8.1 freezes up when I try to import a delimited text layer from a text file. I am on Windows 7 sp1 (x64).

The file is a simple text file containing x,y,z coordinates using a space as delimiter. The coordinates make up an evenly spaced raster grid in the Sweref99TM projection system (EPSG: 3006).

The first line is a header containing the number of rows and columns in the grid.

I think the problem could be related to precision of the values because I have another file that I created based on this file where the x and y values are smaller. What I mean is that for the x values I subtracted 586800 and for the y values i subtracted 7058270 and I left the z values alone. I could easily import the 'xyz working' file without any problems and both files were created in Matlab using the same delimiters and file writing routines.

For example the xyz coordinates in the 'xyz not working.dat' file looks like this:

586806.602 7058275.668 195.990

While in the 'xyz working.dat' file the xyz is this:

6.602000 75.668000 195.990000

I have attached both files to this bug report.
Please feel free to contact me for more information or if there is anyway I can help.

Thank you.
Norris

xyz_not_working.dat Magnifier (1.24 MB) norris lam, 2015-04-03 11:31 PM

xyz_working.dat Magnifier (1.24 MB) norris lam, 2015-04-03 11:31 PM

xyz_not_working.dat Magnifier (1.24 MB) Giovanni Manghi, 2015-04-04 10:34 AM

History

#1 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Open to Feedback
  • File xyz_not_working.datMagnifier added
  • Category set to Data Provider/Delimited Text

Cannot confirm here, tested on 2.8.1/master on both Windows and Linux.

The issue with the xyz_not_working.dat file is that end of lines are defined as "Macintosh", set them as Linux or Windows and the file imports with no issues. Anyway no crash/freeze even if not changing this property of the file. Attached the modified version.

#2 Updated by Maximilian Krambach over 9 years ago

On Debian Linux (QGIS 2.8.1) it is working fine. I noticed the "newline" separator was set to "macintosh" in the non-working.dat, whereas in the working.dat it reported as "unix". Maybe that's the problem?

#3 Updated by norris lam over 9 years ago

Giovanni Manghi wrote:

Cannot confirm here, tested on 2.8.1/master on both Windows and Linux.

The issue with the xyz_not_working.dat file is that end of lines are defined as "Macintosh", set them as Linux or Windows and the file imports with no issues. Anyway no crash/freeze even if not changing this property of the file. Attached the modified version.

Thanks Giovanni for the fixed file and tip on the 'Mac' end of line. I was able to regenerate the file in Matlab with the proper new line and it works perfectly now ('wt' option instead of 'w' for anyone interested).

By the way, how were you able to 'see' that it was 'Mac' instead of 'Win/Linux'? It would be great for me to learn how to do that and troubleshoot on my own.

But I still get the freeze up when using the 'wrong' new line.

I forgot to mention that I am running win 7 in a virtual box under mac (parallels 8) and I dont have it connect to the internet. So I have never done any updates on this. Maybe that has something to do with it?

Anyway, let me know if I can help in any way to track this bug down.

Also, thanks Maximilian for the suggestion.

Happy Easter guys!

#4 Updated by Giovanni Manghi over 9 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Also available in: Atom PDF