LAStools - Convert ESRI ASCII Raster format(.ASC) to LAS.

6,089 views
Skip to first unread message

WiLdCaT_Quebec

unread,
Mar 26, 2012, 10:40:50 AM3/26/12
to LAStools - efficient tools for LiDAR processing
Hello Everybody, i would like to convert a ASC ESRI LIDAR file to LAS
standards.

The file are in this format :
http://resources.esri.com/help/9.3/arcgisengine/java/GP_ToolRef/spatial_analyst_tools/esri_ascii_raster_format.htm

The Header :

ncols 979
nrows 947
xllcenter 394637.500
yllcenter 5158838.500
cellsize 1.0000
nodata_value -9999

Its is possible to use txt2las.exe (i tried but it not work)

Nick Vaughn

unread,
Mar 26, 2012, 4:25:47 PM3/26/12
to last...@googlegroups.com
Hi WiLdCaT,
It would be very helpful to get more information from you. For
instance rather than say "it did not work", copy the command line and
the program output. However it appears that you are trying to convert
a raster image (perhaps an elevation model) into discrete x,y,z data.
That is not the purpose of txt2las which is designed to convert x,y,z
data from a text format to LAS binary format.

Hope this helps,
Nick

> --
> Download LAStools at
> http://lastools.org/
> Visit the LAStools group at
> http://groups.google.com/group/lastools/
> Be social with LAStools at
> http://www.facebook.com/LAStools
> http://www.twitter.com/LAStools

chuck

unread,
Mar 26, 2012, 5:01:38 PM3/26/12
to LAStools - efficient tools for LiDAR processing
Hey WiLdCaT,

The Esri ASCII Grid format is a collection of Z values with a
specified X,Y for origin, a value for cell size, and a specified
number of rows and columns as provided by a header file. To convert to
regular X, Y, Z values that might be used as input for TXT2LAS you may
want to look at the following Esri knowledgebase article:

http://support.esri.com/en/knowledgebase/techarticles/detail/28730

This presumes that you have access to ArcGIS, can use ArcMap, and the
Spatial Analyst extension. Otherwise, you may want to write a program
that starts at the LL corner and increments X and Y values based on
the cell size.

Best Regards - Chuck

On Mar 26, 9:40 am, WiLdCaT_Quebec <wildcatque...@gmail.com> wrote:
> Hello Everybody, i would like to convert a ASC ESRI LIDAR file to LAS
> standards.
>
> The file are in this format :http://resources.esri.com/help/9.3/arcgisengine/java/GP_ToolRef/spati...

Terje Mathisen

unread,
Mar 27, 2012, 7:02:26 AM3/27/12
to last...@googlegroups.com

OK, I just spent 30 min writing a tiny perl script which should do the
conversion for you (I haven't done any debugging, not even to check that
it runs, caveat emptor!)

#!perl -w

my ($ncols, $nrows, $xllcorner, $yllcorner, $nodata, $cy, $cx0) = ();
my $body = 0;
while (<>) {
chomp;
if (/NCOLS\s+(\d+)\s*$/) {
$ncols = $1;
}
elsif (/NROWS\s+(\d+)\s*$/) {
$nrows = $1;
}
elsif (/CELLSIZE\s+(\d+)\s*$/) {
$cellsize = $1;
}
elsif (/XLLCENTER\s+(\d+)\s*$/) {
$xllcenter = $1;
}
elsif (/YLLCENTER\s+(\d+)\s*$/) {
$yllcenter = $1;
}
elsif (/XLLCORNER\s+(\d+)\s*$/) {
$xllcorner = $1;
}
elsif (/YLLCORNER\s+(\d+)\s*$/) {
$yllcorner = $1;
}
elsif (/^\s*\d+/) { # A row of height data, convert and dump to output!
if !defined($xllcorner) {
$xllcorner = $xllcenter - ($ncols-1)*0.5*$cellsize;
}
if !defined($yllcorner) {
$yllcorner = $yllcenter - ($nrows-1)*0.5*$cellsize;
}
if !defined($cy) {
$cy = $yllcorner + ($nrows-1)*$cellsize;
$cx0 = $xllcorner;
}
my @row = split;
my $cx = $cx0;
foreach (@row) {
printf("%s %s %s\n", $cx, $cy, $cx);
$cx += $cellsize;
}
$cy += $cellsize;
}
}


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

Martin Isenburg

unread,
Mar 27, 2012, 7:51:20 AM3/27/12
to LAStools - efficient tools for LiDAR processing
Hello WiLdCaT,

support for on-the-fly conversion from raster to LAS was something I
have had already in my "LAStools sandbox". I now moved support for
ESRI ASC ASCII rasters into LASlib so that all LAStools can now read
the *.asc files and the value in the *.asc file is considered to be
the elevation of the point.

Example:

lasgrid -i ..\data\fusa.laz -o fusa.asc
lasview -i fusa.asc
lasinfo -i fusa.asc
las2las -i fusa.asc -o fusa_gridded.laz
las2las -i fusa.asc -o fusa_gridded.las
las2las -i fusa.asc -o fusa_gridded.txt

Cheers,

Martin @lastools

On Mar 26, 7:40 am, WiLdCaT_Quebec <wildcatque...@gmail.com> wrote:
> Hello Everybody, i would like to convert a ASC ESRI LIDAR file to LAS
> standards.
>
> The file are in this format :http://resources.esri.com/help/9.3/arcgisengine/java/GP_ToolRef/spati...

Jason Stoker

unread,
Mar 27, 2012, 10:29:32 AM3/27/12
to LAStools - efficient tools for LiDAR processing
Hi WiLdCaT- I think this brings up an interesting philosophical
question. I don't think the question is necessarily CAN you do this-
(you obviously can- as Martin and Terje have already written something
to do it), but SHOULD you do this? I am curious as to why you would
want to convert a regularly-spaced grid to the las file format. Is it
because there are things lastools can do that other "free" software
cannot? What is your end goal? I can hammer in a nail with a
screwdriver, but unless I am seeing how many screwdriver hits it takes
to hammer in the nail, it doesn't make much sense to use that tool to
do it.

Jason

On Mar 26, 9:40 am, WiLdCaT_Quebec <wildcatque...@gmail.com> wrote:
> Hello Everybody, i would like to convert a ASC ESRI LIDAR file to LAS
> standards.
>
> The file are in this format :http://resources.esri.com/help/9.3/arcgisengine/java/GP_ToolRef/spati...

Wildca...@gmail.com

unread,
Mar 27, 2012, 11:25:11 AM3/27/12
to last...@googlegroups.com
Im really sorry about the quality of my english (i speak french)

I would try the Perl Script;

To Jason;

The Reason is
- I have some trouble to import ASCII ESRI CLOUD in Civil 3D (Many Fata Error) and i try couple software to import/Analyse (Remove Vegetation) and export it in LAS or ENZ format and its not supported.
- I want to make a Library for all LIDAR file we have and put it all in one standard format with the goal to put it in a Linux GIS server.. (im a noob in GIS world)
- I don't want to use ESRI solution because only one people have ArcView in the office and he not there 90% of the time
- I am a OpenSource Lover.

- I found SAGA its convert my data but i have a trouble to make a batch file to convert all the data.



Le , Jason Stoker <jsto...@gmail.com> a écrit :

Doug_N...@fws.gov

unread,
Mar 27, 2012, 11:34:01 AM3/27/12
to last...@googlegroups.com

WildcatQuebec,

Not to take away from the great work that Martin is doing, but you might want to look at GRASS as well.

http://grass.fbk.eu/grass64/manuals/html64_user/r.in.arc.html
http://grass.fbk.eu/grass64/manuals/html64_user/r.out.xyz.html

Then take the xyz points into LAS with lastools

Doug



Doug Newcomb            
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_n...@fws.gov
---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior.   Life is too short for undocumented, proprietary data formats.



Wildca...@gmail.com
Sent by: last...@googlegroups.com

03/27/2012 11:28 AM

Please respond to
last...@googlegroups.com

To
last...@googlegroups.com
cc
Subject
Re: [LAStools] Re: LAStools - Convert ESRI ASCII Raster format(.ASC) to LAS.


Reply all
Reply to author
Forward
0 new messages