troubles changing point source id

257 views
Skip to first unread message

Clemens B

unread,
Jan 21, 2014, 8:37:14 AM1/21/14
to last...@googlegroups.com

Hi!

I am trying to change the point_source ID.

I used

lasinfo -i D:\Users\Masterarbeit\Gebiet1\25021.las -set_point_source_to 25021

and

lasinfo -i D:\Users\Masterarbeit\Gebiet1\25021.las -change_point_source_from_to 21 25021

The program runs correctly and in the cmd it looks like the values have changed, but when I start lasinfo to check, the old values are still there.

So I tried this command:

las2las -i D:\Users\Masterarbeit\Gebiet1\25021-o D:\Users\Masterarbeit\Gebiet1\25021neu.las -set_point_source 25021

It creates the new file and the point_source ID is changed correct.

I would not prefer using las2las to create a new file and just use the lasinfo command to change the exsisting file.  What am I doing wrong?

I also change the file source id and the file creation date with the lasinfo tool. They change correctly and also stay changed, only the point source is not working for me.

Thanks for your help!

Regards,
Clemens

Btw: Lastools is really awesome!

Terje Mathisen

unread,
Jan 21, 2014, 9:44:17 AM1/21/14
to last...@googlegroups.com
Clemens B wrote:
> Hi!
>
> I am trying to change the point_source ID.
>
> I used
>
> lasinfo -i D:\Users\Masterarbeit\Gebiet1\25021.las -set_point_source_to
> 25021
>
> and
>
> lasinfo -i D:\Users\Masterarbeit\Gebiet1\25021.las
> -change_point_source_from_to 21 25021
>
> The program runs correctly and in the cmd it looks like the values have
> changed, but when I start lasinfo to check, the old values are still there.
>
> So I tried this command:
>
> las2las -i D:\Users\Masterarbeit\Gebiet1\25021-o
> D:\Users\Masterarbeit\Gebiet1\25021neu.las -set_point_source 25021
>
> It creates the new file and the point_source ID is changed correct.
>
> I would not prefer using las2las to create a new file and just use the
> lasinfo command to change the exsisting file. What am I doing wrong?

IMHO it would be really wrong for a program with the name lasinfo to
actually modify any data, but I see below that lasinfo does seem able to
modify just the header.

It is of course much safer to just touch the LAS header data, it can be
done in-place, while if you want to modify every point record, you
really cannot do so if the source file is in the LAZ format:

Modifying the point_source value, setting it to be the same for all
records, will of course also impact the compressibility of that data,
i.e. you pretty much _have_ to rewrite a new LAZ file in order to do so!
>
> I also change the file source id and the file creation date with the
> lasinfo tool. They change correctly and also stay changed, only the
> point source is not working for me.

You hould not do this either, the original source files should stay as a
read-only ultimate reference, making it possible to recover/redo any
intermediate processing stages.

Terje
>
> Thanks for your help!
>
> Regards,
> Clemens
>
> Btw: Lastools is really awesome!
>
> --
> 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"

ka...@heidemann.us

unread,
Jan 21, 2014, 12:57:49 PM1/21/14
to last...@googlegroups.com
First, as a matter of terminology, if you are referring to the "ID" in the Header, that is the File_Source_ID.
Second, assuming the file is an original swath, or is comprised solely of points from a single swath, if you change the File_Source_ID in the header, you should (technically, must, to remain compliant with the LAS specification) also change the Point_Source_ID for each point in the file.

If your data is already cut into tiles created from multiple swaths ... this presents another problem altogether, as each tile should contain points referencing the original source file IDs that now no longer exist. You COULD undertake to change all the swath IDs, then correspondingly change all the point IDs  ... Original_ID --> Your_New_ID, but this will be arduous and very prone to error.   And although it is not required and rarely done, you should add a VLR to each tile file, listing which File_Source_IDs are present in each tile.

I second Terje's recommendation: File_Source_ID should never be changed in the original files, with this caveat:

It appears that you are attempting to prepend some digits to the existing ID. If this is consistently the case for the entire project, and the original ID will remain an immediately recognizable part of the new File_Source_ID, you could create new files with new File_Source_IDs AND Point_Source_IDs; verify that nothing else has changed, then delete the true originals, and call your new files "original".

Karl

Clemens B

unread,
Jan 22, 2014, 4:53:15 AM1/22/14
to last...@googlegroups.com

Thanks for your help, guys.

Yes I am referring to File_Source_ID and Point_Source_ID and the file is an original swath. This is what I am trying to do, to fulfil the specifications of the LAS 1.1. The two IDs are wrong and must be changed.

The Original Files are save will be not altered.  I was trying to save disk space and time, because first it looked like that the lasinfo command was faster than the las2las.

I will now use las2las, but I think it’s confusing that the  -set_point_source_to  and  -change_point_source_from_to commands are included in the lasinfo_README.txt.

Steven F

unread,
Feb 6, 2014, 11:21:30 AM2/6/14
to last...@googlegroups.com
Is there a lastools command that can change the point_source_id to match the file_source_id? I haven't found any in the documentation, but I may have missed something or it might be an undocumented feature. I've been using a batch script to do this, but I'll bet most people just use the -files_are_flightlines call which just assigns a unique number that isn't necessarily the file_source_id.

Steve

Martin Isenburg

unread,
Feb 7, 2014, 8:27:40 AM2/7/14
to last...@googlegroups.com
Hello Steven,

good timing with your question. I was just about to release a new version (140207) and adding this functionality had been on my list for a while. It is now realized as the '- apply_file_source_ID' command line option (not exposed in the GUIs yet). Here you see it at work on seven strips for which i manually set the file_source_IDs to 32, 33, ... 38 with 'lasinfo' and the '-set_file_source_ID 32' option.

lasinfo -i strips_raw\LD*.laz -merged ^
            -apply_file_source_ID ^
            -nh -nv -nmm ^
            -histo point_source 1 
point source id histogram with bin size 1
  bin 32 has 2404613
  bin 33 has 2983331
  bin 34 has 2208166
  bin 35 has 2920460
  bin 36 has 2660474
  bin 37 has 838865
  bin 38 has 2423315
  average point source id 34.77

See 7 strips are those used in these tutorials after manually setting the file_source_IDs to 32, 33, ... 38 

http://rapidlasso.com/2013/04/20/tutorial-quality-checking/
http://rapidlasso.com/2013/10/13/tutorial-lidar-preparation/
http://rapidlasso.com/2013/10/20/tutorial-derivative-production/

So yes, a new LAStools version is out (140207). Especially lascanopy, lascolor, and blast2dem were improved a bit or had bugs fixed . 

Btw ... these seven raw strips contain some unknown values in the point source ID field as noted and visualized in the quality check tutorial linked above. Looking at the histogram below  it can be anyone's guess what value was stored there. Neither appears to be intensity nor height above ground.

Regards,

Martin @rapidlasso

=======================

lasinfo -i strips_raw\LD*.laz -merged ^
            -nh -nv -nmm ^
            -histo point_source 1 
point source id histogram with bin size 1
  bin 0 has 15140
  bin 1 has 12
  bin 2 has 25
  bin 3 has 7
  bin 4 has 6
  bin 5 has 10
  bin 6 has 7
  bin 7 has 3
  bin 8 has 5
  bin 68 has 1
  bin 69 has 2
  bin 70 has 2
  bin 71 has 5
  bin 72 has 13
  bin 73 has 1
  bin 74 has 12
  bin 75 has 1
  bin 76 has 3
  bin 78 has 1
  bin 79 has 3
  bin 85 has 3
  bin 86 has 2
  bin 87 has 1
  bin 104 has 9
  bin 106 has 1
  bin 109 has 2
  bin 110 has 2
  bin 111 has 1
  bin 114 has 9378
  bin 115 has 320660
  bin 116 has 69759
  bin 117 has 1334620
  bin 118 has 635791
  bin 119 has 1381394
  bin 120 has 2888980
  bin 121 has 494355
  bin 122 has 3322577
  bin 123 has 170535
  bin 124 has 1496400
  bin 125 has 382097
  bin 126 has 524478
  bin 127 has 602057
  bin 128 has 130055
  bin 129 has 762358
  bin 130 has 51463
  bin 131 has 578450
  bin 132 has 88324
  bin 133 has 233899
  bin 134 has 159642
  bin 135 has 55342
  bin 136 has 156088
  bin 137 has 13180
  bin 138 has 96163
  bin 139 has 19049
  bin 140 has 48167
  bin 141 has 24284
  bin 142 has 25758
  bin 143 has 41496
  bin 144 has 10266
  bin 145 has 51295
  bin 146 has 7435
  bin 147 has 39062
  bin 148 has 13545
  bin 149 has 20555
  bin 150 has 15474
  bin 151 has 5556
  bin 152 has 16774
  bin 153 has 2224
  bin 154 has 13597
  bin 155 has 2703
  bin 156 has 8160
  bin 157 has 5018
  bin 158 has 4384
  bin 159 has 7708
  bin 160 has 908
  bin 161 has 8294
  bin 162 has 1024
  bin 163 has 6276
  bin 164 has 1877
  bin 165 has 2666
  bin 166 has 2560
  bin 167 has 521
  bin 168 has 1182
  bin 169 has 139
  bin 170 has 471
  bin 171 has 51
  bin 172 has 394
  bin 173 has 125
  bin 174 has 154
  bin 175 has 256
  bin 176 has 132
  bin 177 has 634
  bin 178 has 132
  bin 179 has 552
  bin 180 has 225
  bin 181 has 407
  bin 182 has 273
  bin 183 has 238
  bin 184 has 476
  bin 185 has 138
  bin 186 has 714
  bin 187 has 152
  bin 188 has 665
  bin 189 has 343
  bin 190 has 432
  bin 191 has 571
  bin 192 has 159
  bin 193 has 773
  bin 194 has 159
  bin 195 has 784
  bin 196 has 310
  bin 197 has 519
  bin 198 has 694
  bin 199 has 206
  bin 200 has 931
  bin 201 has 78
  bin 202 has 696
  bin 203 has 164
  bin 204 has 441
  bin 205 has 277
  bin 206 has 124
  bin 207 has 493
  bin 208 has 59
  bin 209 has 478
  bin 210 has 92
  bin 211 has 292
  bin 212 has 252
  bin 213 has 207
  bin 214 has 295
  bin 215 has 70
  bin 216 has 443
  bin 217 has 42
  bin 218 has 314
  bin 219 has 135
  bin 220 has 215
  bin 221 has 237
  bin 222 has 130
  bin 223 has 404
  bin 224 has 38
  bin 225 has 373
  bin 226 has 66
  bin 227 has 339
  bin 228 has 171
  bin 229 has 175
  bin 230 has 356
  bin 231 has 115
  bin 232 has 566
  bin 233 has 60
  bin 234 has 607
  bin 235 has 182
  bin 236 has 578
  bin 237 has 266
  bin 238 has 613
  bin 239 has 374
  bin 240 has 1244
  bin 241 has 546
  bin 242 has 2350
  bin 243 has 1164
  bin 244 has 3702
  bin 245 has 2382
  bin 246 has 5724
  bin 247 has 2801
  bin 248 has 14107
  bin 249 has 906
  bin 250 has 1
  bin 252 has 10
  bin 253 has 5
  bin 254 has 12
  bin 255 has 101
  average point source id 123.416

Steven F

unread,
Oct 28, 2014, 12:15:24 AM10/28/14
to last...@googlegroups.com
Thanks for adding this feature Martin. I finally had an opportunity to use it today. 
I just wanted to note to others that this call is not compatible with the "-cores" option. It took me awhile to discover this.

For example, this works: 
las2las -i *.las -apply_file_source_ID -odir ../ptsrc

But this:
las2las -i *.las -apply_file_source_ID -odir ../ptsrc -cores 4
will set the point source to 0.

Martin Isenburg

unread,
Jan 2, 2015, 3:33:43 AM1/2/15
to LAStools - efficient command line tools for LIDAR processing
Hello Steven,

in the past few releases of LAStools (the latest one is 141218) the bug that las2las does not '-apply_file_source_ID'when run on mutliple cores with -cores 4 should have been fixed. Thanks for reporting this bug and please report all future miss-behaviours such as this one as well.

Regards,

Martin @rapidlasso

--
http://rapidlasso.com - fast tools using all CPUs for your LiDARs

Reply all
Reply to author
Forward
0 new messages