Chris Gkikas and I were messaging the other day about a problematic set of downloaded lidar that was causing KP to lock up in the vegetation generation step.
I noticed it had negative easting coordinates, and I guessed that might be the issue, and also it just seemed wrong.
Chris had already done what I normally recommend, which is to run lasinfo:
lasinfo -i input_file.laz -otxt
That creates a report. Sometimes and in this case, there is metadata embedded in the laz file. This was one of the report headings:
description 'WKT Projection'
We googled WKT, and there is a wiki page. It means Well-Known Text, and it's a standard way of including projection and metadata information. So I looked for projection, saw EPSG 8901, and thought I was home free. But then I looked for it again and found a different EPSG number and then several. I hope this pastes (I've added spaces and underlined the instances of EPSG):
OGC COORDINATE SYSTEM WKT:
COMPD_CS["NAD83 / Conus Albers + NAVD88 height - Geoid12B (meters)",PROJCS["NAD83 / Conus Albers",GEOGCS["NAD83",DATUM["North_American_Datum_ 1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]] ,TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM[ "Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree", 0.0174532925199433,AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4269"]],PROJECTION[ "Albers_Conic_Equal_Area"],PARAMETER ["standard_parallel_1",29.5],PARAMETER["standard_parallel_2", 45.5],PARAMETER["latitude_of_center",23],PARAMETER ["longitude_of_center",-96],PARAMETER["false_easting",0], PARAMETER["false_northing",0],UNIT["meter",1,AUTHORITY ["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY ["EPSG","5070"]],VERT_CS["NAVD88 height - Geoid12B (meters)",VERT_DATUM["North American Vertical Datum 1988",2005,AUTHORITY["EPSG","5103"]],UNIT["meter",1, AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY ["EPSG","5703"]]]
I guessed (without evidence) that this tile was converted from a downloaded bigger file, and that something was messed up, or it was tiled from several different datasets.
If you know the "input file" projection, you can write a command line similar to this to reproject it:
las2las -i *.las -sp83 OR_N -feet -elevation_feet -target_utm 17N -target_meter -target_elevation_meter -olaz
(If you don't know, this is saying
-i *.las The input file is all the las files
-sp83 OR_N The input file's projection is Oregon North, as defined in SP83
-feet -elevation_feet The input file's coordinates are feet and the elevations are in feet (international feet, not survey feet!)
-target_utm 17N I want the output file to be in UTM Zone 17 Northern Hemisphere
-target_meter -target_elevation_meter (I want the output units to be meters---this isn't actually needed, because the default output for UTM is in meters)
-olaz Make the output file be in .laz format (saves *lots* of space on your harddrive)
Anyway, Chris tried this command line, which *doesn't specify* the "input file's projection", only the target---and it worked. So LAStools was somehow able to know what projection the data was in because of the embedded WKT metadata.
las2las -i *.laz -olaz -target_utm 12N
For those who don't know, this is saying:
-i *.laz the input file is all the "laz" files
-olaz the output should be in laz format
-target_utm 12N "the target projection to convert the input file into" is UTM zone 12 Northern Hemisphere (with meters the default units).
1. In the second comment in this thread, hughmac⁴ uses this "don't specify the input projection", but he does specify the units of the input are in feet. If you want to specify the units of the output file, especially if they're different from the default units, you need "target" commands:
or something similar (feet or surveyfeet) (see the las2las readme file)
2. ledusledus suggested this command line to create the txt file needed by KP:
las2txt -i tile_1300000_195000.laz -o full.laz.xyz -scale_x 0.3048 -scale_y 0.3048 -scale_z 0.3048 -parse xyzcnri
I'd suggest this is bad for two reasons.
a. It's better to have the input in laz format for space reasons, and to just paste a copy of las2txt.exe into the KP directory. KP will use las2txt.exe to create whatever txt input file it wants from the laz file. (I often delete the xyz files after I run KP just to free up space.)
b. It's not a good practice to just use the 0.3048 conversion factor for feet to meters. The problem is it doesn't take into account the false easting of 500,000m for meters and 1,500,000 feet for feet. 500000m does not equal 1500000ft. If you want the output files to automatically align with aerials and other data, you need to convert to a known projection. I use UTM because it's so well known and its default units are meters. Also, the 0.3048 is only exact for international feet (1" = 2.54cm). For survey feet it's 0.3048006096. Sure, it's close enough for nearly everything, but if you can easily reproject the data and have everything line up, it's worth taking that time.
And I will admit to using 0.3048 conversions if I'm planning to do it right later. I've even just created a grid of 3m or 6m, but given the program data in feet, which means the grid is actually 3ft and 6ft. I did that back when I had no idea how to reproject, and I still do it if I want to see some rocket fast output (I use 3m/6m/10m grids even on data in both feet and meters just to quickly see outputs and diagnose problems.)