2

I have these LIDAR data *.xyz files (1st col x, 2nd col y, 3rd col z)

485000.16 6508997.48 1.84
485001.27 6508998.92 1.86
485001.02 6508996.68 1.85
485000.77 6508994.45 1.79
485000.52 6508992.19 1.79
485000.02 6508987.69 1.74
485000.23 6508974.93 1.89
485001.02 6508981.87 1.86
485001.54 6508986.50 1.72
485002.32 6508993.34 1.72

...and I want to import them to GRASS GIS. I've tried with one file but r.in.xyz doesn't seem to work. All the program says is that:

r.in.xyz
input=C:\Users\Siim\SkyDrive\Dokumendid\kool\magistritoo\lidarandmed\filtreeritud\508485.xyz output=508485 fs= 
Reading data ...
Writing to map ...
r.in.xyz complete. 0 points found in region.
(Mon Feb 09 20:17:26 2015) Command finished (1 sec)
  • Did you really set the field separator properly? I see empty rather than fs=" ". Or simply use fs=space to get the command working for your case. – markusN Feb 12 '15 at 18:26
3

Looks to me like you have the x and y mixed up. Your region's north is 485999 but the maximum y in the input file is 6508999. Try setting the region as:

g.region -p n=6509000 s=6508000 e=486000 w=485000 res=2

Then do your r.in.xyz command.

4

As the result is a raster, you need to fix the region before importing the points. Unfortunately, r.in.xyz does not allow you to do that directly (as other commands).

Whith your 10 points in the GRASS shell (or in the Command console):

r.in.xyz input=test.xyz  output=testxyz  x=1 y=2 z=3 fs=' ' 
Reading data ...
100%
Writing to map ...
100%
r.in.xyz complete. 0 points found in region.

The message specifies that no point has been found in the current region.

Many solutions are proposed in GRASS wiki: import XYZ:

For example, a solution with the s flag:

 r.in.xyz -s input=test.xyz  output=test2xyz  x=1 y=2 z=3 fs=' ' 
 Range:     min         max
 x: 85000.160000 485002.320000
 y: 6508974.930000 6508998.920000
 z:    1.720000    1.890000

Fix a new region with these parameters

 g.region n=6508998.920000 s=6508974.930000 e=485002.320000 w=85000.160000  res=2

And import the file:

 r.in.xyz input=test.xyz  output=test2xyz  x=1 y=2 z=3 fs=' ' 
 Reading data ...
 100%
 Writing to map ...
 100%
 r.in.xyz complete. 9 points found in region.

New

Your region is not correct, you have interchanged the x (west, east) and y (south-north) in the definition of the region.

If the result of r.in.xyz -s is :

x: 484999.980000 485999.980000  -> w and e
y: 6507999.880000 6508999.860000 -> s and n
z: 0.230000 6.160000 

You fix the region with:

g.region n=6508999.860000  s=6507999.880000 e=485999.980000  w=484999.980000  res=2

and the result is

g.region -p
projection: 99 (Lambert Conformal Conic)
.... 
north:      6508999.86
south:      6507999.88
west:       484999.98
east:       485999.98
....

And not:

north: 485999.98
south: 484999.98 
west: 6507999.88 
east: 6508999.86

As in you case

  • I don't know, but in my case, no syntax error (I am not on Windows) Try with another name for output (not beginning with a number) – gene Feb 10 '15 at 17:38
  • I got everything OK with that previous syntax error, but now I have problem with importing *.xyz file although region is set. It says: Reading data ... Writing to map ... r.in.xyz complete. 0 points found in region. – Siim Feb 10 '15 at 17:46
  • I run an automated GRASS script several times a day with exactly the commands that gene suggested. So it most certainly DOES work. Can you report the output of r.in.xyz -s, and also g.region -p ?? – Micha Feb 10 '15 at 19:17
  • r.in.xyz -s input=C:\Users\Siim\SkyDrive\Dokumendid\kool\magistritoo\lidarandmed\filtreeritud\508485.xyz output=508485 fs= x: 484999.980000 485999.980000 y: 6507999.880000 6508999.860000 z: 0.230000 6.160000 Range: min max (Wed Feb 11 16:14:30 2015) Command finished (1 sec) – Siim Feb 11 '15 at 14:15
  • g.region -p projection: 99 (Lambert Conformal Conic) zone: 0 datum: towgs84=0,0,0,0,0,0,0 ellipsoid: grs80 north: 485999.98 south: 484999.98 west: 6507999.88 east: 6508999.86 nsres: 2 ewres: 1.99996 rows: 500 cols: 500 cells: 250000 (Wed Feb 11 16:16:21 2015) Command finished (0 sec) – Siim Feb 11 '15 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.