APIs to read and write Coordinate Reference System

95 views
Skip to first unread message

Manoj

unread,
Jun 15, 2022, 3:01:50 AM6/15/22
to LAStools - efficient tools for LiDAR processing

The las 1.4 specs tells that Coordinate Reference System is stored as VLR.

What is the api to read a VLR (the VLR that has Ref info)from .laz file and write it to 1.4 las file.

Command line laszip is able to convert a 1.4 laz to a 1.4 las that retains the spatial reference information. So I think there would be an APIs for it.

Jochen Rapidlasso

unread,
Jun 15, 2022, 3:34:59 AM6/15/22
to LAStools - efficient tools for LiDAR processing
Hi Manoj,
LAStools are commandline tools - so api is may not the right term.
Also in general: Each LAStool processing lidar data should retain the spatial reference information unless you tell not to do.
But you can extract VLRs by use of las2las with parameter
-save_vlrs                          (saves all VLRs to a file called vlrs.vlr so they can be loaded into another file)
to extract vlrs into a simple file and
-load_vlrs                          (loads all VLRs from a file called vlrs.vlr and adds them to each processed file)
to load those into another LAS or LAZ file.
There are some other features to process VLRs - just see the new las2las_README.md 
reference documentation.
Best,
Jochen @rapidlasso

Kirk Waters - NOAA Federal

unread,
Jun 15, 2022, 7:54:07 AM6/15/22
to LAStools - efficient command line tools for LIDAR processing
Manoj,
I assume you're trying to write your own code that needs that functionality and want to leverage the library functions under LASlib versus using the existing command tools. I don't think there is a documented API for that. I've generally looked at the code for the existing tools to figure out how the underlying library can be called. In this case, the las2las code would probably be a good starting point.

Kirk Waters, PhD 
NOAA Office for Coastal Management
Applied Sciences Program      
‪Phone: 843-284-6962‬ (New as of 2022)    




--
Download LAStools at
https://rapidlasso.de
Manage your settings at
https://groups.google.com/g/lastools/membership
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/fedfb524-06d2-4346-8215-0b5963cd446bn%40googlegroups.com.

Peter Guth

unread,
Jun 15, 2022, 11:08:56 AM6/15/22
to last...@googlegroups.com
Hi,

Or you use the command line tool, save the VLR to a text file, and then process the text file on your own.



--
Peter L. Guth
Professor, Dept Oceanography, USNA

Manoj Lnu

unread,
Jun 16, 2022, 4:12:05 AM6/16/22
to last...@googlegroups.com
@Jochen,

I was not clear enough. I am using lazzip.dll and hence used the term API (though with no documentation and mostly void *  parameters) 
I presumed that API offered by the dll are used in the code that creates .exe of las tools. 

@Peter
Your guess is correct. 
I plan to debug las2las.exe  and laszip.exe to know the code/function/API. 
Right now I'm having a problem compiling the code and  I will send a separate email on it. 

-Best,
 Manoj

Reply all
Reply to author
Forward
0 new messages