Opened 11 years ago
Last modified 9 years ago
#2125 assigned defect
r.in.xyz not importing data when line is 800 characters long
Reported by: | moreno | Owned by: | hamish |
---|---|---|---|
Priority: | major | Milestone: | 6.4.6 |
Component: | Raster | Version: | 6.4.3 |
Keywords: | r.in.xyz | Cc: | grass-dev@… |
CPU: | x86-64 | Platform: | All |
Description
When trying to import data from ASCII file using r.in.xyz, in case of too many decimal digits I get the message "not enough data columns".
r.in.xyz "input=C:/Documents and Settings/moreno/Desktop/dati.txt" method=min type=FCELL fs=\t x=1 y=2 z=15 output=import_xyz
data in attach (it's always the same number, just to show an example)
Attachments (1)
Change History (9)
by , 11 years ago
follow-up: 2 comment:1 by , 11 years ago
Milestone: | 6.4.3 → 6.4.4 |
---|---|
Platform: | MSWindows XP → All |
Priority: | critical → major |
follow-up: 3 comment:2 by , 11 years ago
Replying to annakrat:
It fails because the length of the line in your file exceeds the maximum buffer size (256). But of course, it should not fail when the item corresponding to the maximum column requested is still within that buffer. Maybe related to this discussion?
I think it's not related, the problem with r.in.xyz occours also in the middle of the line, not at the ond of it (so, it doesn't depend on the EOL out of buffer)
comment:3 by , 11 years ago
Replying to moreno:
Replying to annakrat:
It fails because the length of the line in your file exceeds the maximum buffer size (256). But of course, it should not fail when the item corresponding to the maximum column requested is still within that buffer. Maybe related to this discussion?
I think it's not related, the problem with r.in.xyz occours also in the middle of the line, not at the ond of it (so, it doesn't depend on the EOL out of buffer)
Well, you can simply test it on your data, when you make the lines in the CSV file shorter. With max 254 characters per line, it starts to work for me. The problem is that everything after the limit is then read into the next line instead of the next line itself.
comment:4 by , 11 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Hi,
I have increased the buffer size to 1024 chars in the development branches r58203,4. It doesn't really fix the heart of the problem but fixes it for you and makes it less likely to occur in the future (maybe we should keep going to 4096 chars). Please test with tomorrow's nightly build of WinGrass 6.5.
When the line is longer than the specified input buffer I'm not sure if it really matters if G_getl2() flushes the rest of the line or not. Either way the data-read has gone wrong and you'll want a G_fatal_error(), so the question becomes at what point to throw that error, and what the error should say. _("Line is too long for input buffer") might be a good candidate for what it should say.
thanks, Hamish
ps- consider to use fs=tab instead of fs='\t'.
comment:5 by , 11 years ago
Summary: | r.in.xyz not importing data with 5 decimal digits → r.in.xyz not importing data when line is 800 characters long |
---|
comment:6 by , 10 years ago
Milestone: | 6.4.4 → 6.4.5 |
---|
comment:8 by , 9 years ago
Milestone: | → 6.4.6 |
---|
It fails because the length of the line in your file exceeds the maximum buffer size (256). But of course, it should not fail when the item corresponding to the maximum column requested is still within that buffer. Maybe related to this discussion?