lasgrid: point density with custom color map

253 views
Skip to first unread message

Robert Jurisch

unread,
Oct 22, 2024, 11:00:19 AM10/22/24
to LAStools - efficient tools for LiDAR processing
Cheers,

I am trying to plot the point density. After talking to you at Intergeo I tried lasgrid with the option "-color_map"

my .bat looks like this:

lasgrid64.exe -i *.las -counter_32bit -color_map colormap.txt -false -step 1 -mem 2000 -otif

my color_map.txt looks like this:
0 0x9e0142
1 0x9e0142
2 0x9e0142
3 0x9e0142
4 0x9e0142
5 0x9e0142
6 0x9e0142
7 0x9e0142
8 0x9e0142
9 0x9e0142
10 0xd53e4f
11 0xd53e4f
12 0xd53e4f
13 0xd53e4f
...
255 0x5e4fa2

cmd-output looks like this:
WARNING: skipping 0 0x9e0142
WARNING: skipping 1 0x9e0142
WARNING: skipping 2 0x9e0142

for all entries up to 255 and the pictures are grey

Did I wrongly define the colormap?
Thanks in advance


Jochen Rapidlasso

unread,
Oct 22, 2024, 11:43:06 AM10/22/24
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
yes you did.
Please see this post how the colormap should look like:

colormap.txt
1 100 100 100
2 250 250 250
3 100 255 200
4  50 255  50
5   1 255   1
9 100 100 250    

(key R G B)

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Oct 23, 2024, 7:07:21 AM10/23/24
to LAStools - efficient tools for LiDAR processing
Good morning Jochen,

defining the color values as RGB worked.

But first I got the following error code:
ERROR: classification c is 64 but needs to between 0 and 63

So I reduced the entries in my color map to 0-63 and got pictures which were fitting to my colors :)

Is it possible to map more than 64 points as we have projects with 100++ points per m² here and there?

Jochen Rapidlasso

unread,
Oct 25, 2024, 5:17:47 AM10/25/24
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
yes, we see this is a limitation.
We will expand the color table to more than 64 colors.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Oct 28, 2024, 9:59:22 AM10/28/24
to LAStools - efficient tools for LiDAR processing
Thanks for the information and the effort! :)

Have a great one

Jochen Rapidlasso

unread,
Nov 4, 2024, 4:38:29 AM11/4/24
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
latest version of LAStools support now more than 64 colors in color table.
Please just download the latest version.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Nov 15, 2024, 8:13:28 AM11/15/24
to LAStools - efficient tools for LiDAR processing
Hi,

wow, that was a very fast implementation :) As I am processing a project with high point density I've already tried it out and everything works fine. Thank you.

Out of interest: What is the current max point density/m² which can be processed?

Jochen Rapidlasso

unread,
Nov 18, 2024, 7:12:41 AM11/18/24
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
you're welcome.
About the max point density: There should not be a limitation, the counter is u. If you use "-counter_32bit" as aggregate value you should be able to count up to 4.294.967.295 points per grid cell.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Dec 6, 2024, 1:52:25 AM12/6/24
to LAStools - efficient tools for LiDAR processing
Well, I'm sure this will be sufficient for the next 2-3 years ;)

During the first projects we found a little problem/bug regarding the no data value.

per default lasgrid uses black for the no data cells (at least with the -otif), we tried setting a costum no data value in the colormap (0 R G B) but lasgrid still uses black

Is there another way to set a costum no data value?

Thanks in advance

Jochen Rapidlasso

unread,
Dec 9, 2024, 10:34:38 AM12/9/24
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
the "-no_data" argument should work with TIF output.
Also you have an new argument "-no_data_alpha" which will set the no data values to transparent using the alpha channel.
If it does not work with the latest version please provide a small sample and we will have a look at your data and will see what happen there.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Jan 10, 2025, 4:09:48 AMJan 10
to LAStools - efficient tools for LiDAR processing
Hey,

hope you all had nice holidays and a smooth start into 2025 :)

> "-no_data" argument
it seems to only work with numeric values. I cannot define a no-data rgb value

> "-no_data_alpha"
this indeed does work and can be used for some projects

But some of our clients do actually define RGB values which you should be used if there are 0 points in a raster cell.

colormap_client123.png

In my mind it would the easiest way to take this value out of the color_map: if there is a line defining a rgb value for 0 points take that as the no-data value

Cheers
Robert

Jochen Rapidlasso

unread,
Jan 13, 2025, 11:26:58 AMJan 13
to LAStools - efficient tools for LiDAR processing
Hi Robert,
thanks for your suggestion.
This sounds quite reasonable. We will implement this in the next version of lasgrid64.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Jan 15, 2025, 4:02:57 AMJan 15
to LAStools - efficient tools for LiDAR processing
Great, thank you! :)

Jochen Rapidlasso

unread,
Jan 21, 2025, 12:29:59 PMJan 21
to LAStools - efficient tools for LiDAR processing
Hi Jurisch,
lasgrid64 supports an new argument:
     -no_data_map [n]   : use [n] to specify the key from the color_map and set its value to all rasters with no data
You can download a beta at
Please give feedback if this works as expected.

Cheers,

Jochen @rapidlasso

Robert Jurisch

unread,
Jan 24, 2025, 3:04:03 AMJan 24
to LAStools - efficient tools for LiDAR processing
Hey Jochen,

it worked as expected! :)

cheers,
Robert
Reply all
Reply to author
Forward
0 new messages