AW: [GRASS-user] v.in.ascii error: G_realloc

-----Ursprüngliche Nachricht-----
Von: Maciej Sieczka [mailto:tutey@o2.pl]
Gesendet am: Mittwoch, 16. August 2006 16:00
An: Praktikant/in2 ARP
Cc: 'grassuser@grass.itc.it'
Betreff: Re: [GRASS-user] v.in.ascii error: G_realloc

I can't help you with v.surf.rst then. But maybe you could try the
nnbathy tool from nn library (if natural neighbor interpolation suits
your needs). It should let you interpolate a huge raster, and requires
only simple x,y,z ASCII input.

1. download nn.tar.gz from http://www.marine.csiro.au/~sakov/
2. tar xzvf nn.tar.gz
3. cd nn
4. ./configure
5. make
6. gcc -o nnbathy nnbathy.c -g -O2 -Wall -pedantic -I. -DNN_SERIAL
libnn.a -lm
7. chmod u+x ./nnbathy

Copy the nnbathy executable to a directory listed in your PATH.

Run it as:

nnbathy -W 0 -P alg=nn -n "$cols"x"$rows" -x "$west" "$east" -y "$north"
"$south" -i your_huge_xyz_input > interpolated_xyz_output

where cols, rows, east etc. are your region settings obtained with
g.region -g.

Now import interpolated_xyz_output directly as a raster with r.in.xyz or
see lines 155-165 of my r.surf.nnbathy (on Grass WIKI) for how to
transform it into Grass ascii raster to be imported with r.in.ascii.

Refer to nnbathy help screen for details.

Let me know if it worked.

Maciek

Thanks a lot for your help Maciek.

I`ve done everything as described. But when I run

nnbathy -W 0 -P alg=nn -n 300x300 -x 605450 606050 -y 232550 231950 -i dtm >
interpolated_xyz_output

I get an error: Speicherzugriffsfehler (I think its something like
segmentation fault in English)

Maybe there is an error in my input line?

I also tried r.in.xyz and r.surf.nnbathy.
r.in.xyz is working fine. But when I use the created raster I get the error:

r.stats: 100%

nnbathy IN ACTION - MAY TAKE SOME TIME

PLEASE STAND BY UNTIL 'ALL DONE' IS PRINTED

CONVERTING nnbathy OUTPUT TO GRASS RASTER

ERROR: Data conversion failed at row 1, col 1

ALL DONE

Best regards

Michael

Praktikant/in2 ARP napisa?(a):

Thanks a lot for your help Maciek.

I`ve done everything as described. But when I run

nnbathy -W 0 -P alg=nn -n 300x300 -x 605450 606050 -y 232550 231950 -i dtm >
interpolated_xyz_output

I get an error: Speicherzugriffsfehler (I think its something like
segmentation fault in English)

Maybe there is an error in my input line?

I also tried r.in.xyz and r.surf.nnbathy.
r.in.xyz is working fine. But when I use the created raster I get the error:

r.stats: 100%

nnbathy IN ACTION - MAY TAKE SOME TIME

PLEASE STAND BY UNTIL 'ALL DONE' IS PRINTED

CONVERTING nnbathy OUTPUT TO GRASS RASTER

ERROR: Data conversion failed at row 1, col 1

That suggests nnbathy failed, then r.in.ascii couldn't read it's output.
(I should implement some error trapping here, hopefully will do; noted
down.)

Where there any errors when you built the nn library or nnbathy?

How big is your your input dtm text file? Can you send it to me (if not
more than few MB packed) or put somewhere for download?

I just tried reproducing your problem, as far it is possible with
limited information you provided, and nnbathy 1.66 as well as
r.surf.nnbathy work OK for me. I need your data to test further.

Maciek