Re: [LAStools] Convert v large (10 GB) XYI ASCII file to nearest neighbour raster

107 views
Skip to first unread message

Terje Mathisen

unread,
Apr 23, 2013, 7:45:11 AM4/23/13
to last...@googlegroups.com
Garret Duffy wrote:
> Hi,
>
> I have a 10 GB ASCII file (XYI) that was exported from a raster. Data
> is already gridded, I do not want to re-interpolate or re-sample.

OK, so it seems really trivial...
>
> I would like to recreate the raster in ARCGIS, i.e. use LASTOOLS to
> create a ARC raster of identical sample spacing to the ASCII file. I
> think a nearest neighbor, or similar, method would suffice.

Do you need to change the resolution of the raster?

Nearest neighbor etc only comes into play if you are re-sampling!
>
> What would be the most efficient way to achieve this using LASTOOLS?

I'm guessing you could use many of the lastools since you are only
changing the file format, not any of the data!

However, afaik using las2dem or similar will be default use the input
points to construct a TIN, then sample this to generate the output, and
the TINning process really don't want to start with a regular grid!

What about simply using las2las to convert the text file to .las/.laz,
with a single (ground) point per cell, then load that file in ArcGis?

las2las -parse xyzi -i input.txt -o grid.las

Terje
>
> Thanks,
>
> Garret
>
> --
> Download LAStools at
> http://lastools.org
> http://rapidlasso.com
> Be social with LAStools at
> http://facebook.com/LAStools
> http://twitter.com/LAStools
> http://linkedin.com/groups/LAStools-4408378
> Manage your settings at
> http://groups.google.com/group/lastools/subscribe
>
>


--
- <Terje.M...@tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Martin Isenburg

unread,
Apr 23, 2013, 10:06:25 PM4/23/13
to last...@googlegroups.com
Hello Garret,

to "re-grid" an XYZ file that is essentially a grid the best (and
fastest) tool to use is lasgrid. you just have to figure out the
original '-step 1.0' spacing of the XYZ points which you can do with
lasprecision . So I suggest you run:

lasprecision -i ascii.txt -iparse xyz

and then try to decipher the output (read the README of lasprecision)
and then run (with whatever step size you determined)

lasgrid -i ascii.txt -iparse xyz -step 1.0 -o dem.asc
lasgrid -i ascii.txt -iparse xyz -step 1.0 -o dem.img
lasgrid -i ascii.txt -iparse xyz -step 1.0 -o dem.tif -utm 11N

or similar.

Regards,

Martin @rapidlasso

--
http://rapidlasso.com - fast tools to grid your ASCIIs

Garret Duffy

unread,
Apr 24, 2013, 11:27:39 AM4/24/13
to last...@googlegroups.com
Hi Martin,

OK, that works really well. 

However, I notice a shift in pixels when comparing the original geotiff with the lasgrid file. 

The lasgrid file is offset a pixel in the negative X direction and a half pixel in the positive Y direction.  I guess I could manually correct this but just wondering why this would be the case.

Thanks,

Garret
Reply all
Reply to author
Forward
0 new messages