64bit Laslib dll available?

984 views
Skip to first unread message

Owen Ransen

unread,
Dec 9, 2015, 3:29:39 PM12/9/15
to LAStools - efficient tools for LiDAR processing
I'm thinking of making an application which would use laslib (above all for unzipping LAZ files) but can't find if laslib.dll is already available in 64 bit for VS2013, and where to download it.

An alternative I suppose would be to compile the DLL from the laslib sources myself. But again there are so many downloads of laslib.zip available I'm unsure which to use.

Anyway a 64 bit DLL+ lib and H file would be the ideal soution...

Evon Silvia

unread,
Dec 9, 2015, 5:52:17 PM12/9/15
to last...@googlegroups.com
I started a thread about this for MSVC2010 a couple years ago. In September I recompiled it in 64bit following these instructions, so I know they're still more or less valid but I do remember having a little trouble converting the newer DSW into a SLN file. Some of the changes to the source code are no longer necessary... I can't remember which ones off the top of my head. 

I believe I heard that someone successfully repeated this for VS2013.

Good luck!

Evon

Joaquim Luis

unread,
Dec 9, 2015, 6:39:52 PM12/9/15
to last...@googlegroups.com, Evon Silvia
Funny that this comes out right now. I just build laszip yesterday with VS2013 ... BUT

The http://www.laszip.org/ page says that the

Development Source

which has a nice CMake script that makes building the Laszip.dll very easy. However, that source code is 2 years old and notably different (in terms of exported symbols that show up in the Laszip.dll) that the one that we get from the latest  http://lastools.org/download/lastools.zip  file.

Can't the Github source code be updated?

Thanks

Joaquim

Martin Isenburg

unread,
Dec 9, 2015, 7:36:17 PM12/9/15
to LAStools - efficient command line tools for LIDAR processing, Evon Silvia
Hello,

You can find the latest version of LASzip (including the "LAS 1.4 compatibility mode") that is linked by LASlib but also comes with a standalone DLL (that also supports the "LAS 1.4 compatibility mode") via this github link:

http://github.com/LAStools/LAStools/tree/master/LASzip

Once all these (backward-) compatible changes have proven over time they will also be integrated into the somewhat slower advancing version at


that has hisorically mainly been the repository that Howard's libLAS has been linked against. As libLAS does not handle LAS 1.4 there has been no pressing need so far to rush the latest additions (aka the "LAS 1.4 compatibility mode") into that version. 

Regards,

Martin

Joaquim Luis

unread,
Dec 9, 2015, 8:03:28 PM12/9/15
to LAStools - efficient command line tools for LIDAR processing, Martin Isenburg, Evon Silvia
Martin, thank you so much for that pointer.

With the risk of going off topic, could you please point me to code (ore preferably the algorithm) where the scale_factor and offset of a floating point number are computed so that it can be represented as an integer (to go into the 'point' structure)?
It's for a good cause that I'll let you all know in due time.

Joaquim

Martin Isenburg

unread,
Dec 9, 2015, 8:09:53 PM12/9/15
to Joaquim Luis, LAStools - efficient command line tools for LIDAR processing, Evon Silvia
Hello,

for deciding about the scale factors you need to know what resolution makes sense for your point cloud (cm = 0.01 or mm = 0.001 are common). For the offset any large coordinate "near" your data will do just fine. I prefer nice and "round" numbers. Below is how I compute these numbers when converting ASCII TXT to LAS on-the-fly in LASreader_txt.[cpp/h].


Regards,

Martin @rapidlasso

void LASreaderTXT::populate_scale_and_offset()
{
  // if not specified in the command line, set a reasonable scale_factor
  if (scale_factor)
  {
    header.x_scale_factor = scale_factor[0];
    header.y_scale_factor = scale_factor[1];
    header.z_scale_factor = scale_factor[2];
  }
  else
  {
    if (-360 < header.min_x  && -360 < header.min_y && header.max_x < 360 && header.max_y < 360) // do we have longitude / latitude coordinates
    {
      header.x_scale_factor = 1e-7;
      header.y_scale_factor = 1e-7;
    }
    else // then we assume utm or mercator / lambertian projections
    {
      header.x_scale_factor = 0.01;
      header.y_scale_factor = 0.01;
    }
    header.z_scale_factor = 0.01;
  }

  // if not specified in the command line, set a reasonable offset
  if (offset)
  {
    header.x_offset = offset[0];
    header.y_offset = offset[1];
    header.z_offset = offset[2];
  }
  else
  {
    if (F64_IS_FINITE(header.min_x) && F64_IS_FINITE(header.max_x))
      header.x_offset = ((I64)((header.min_x + header.max_x)/header.x_scale_factor/20000000))*10000000*header.x_scale_factor;
    else
      header.x_offset = 0;

    if (F64_IS_FINITE(header.min_y) && F64_IS_FINITE(header.max_y))
      header.y_offset = ((I64)((header.min_y + header.max_y)/header.y_scale_factor/20000000))*10000000*header.y_scale_factor;
    else
      header.y_offset = 0;

    if (F64_IS_FINITE(header.min_z) && F64_IS_FINITE(header.max_z))
      header.z_offset = ((I64)((header.min_z + header.max_z)/header.z_scale_factor/20000000))*10000000*header.z_scale_factor;
    else
      header.z_offset = 0;
  }
}

Joaquim Luis

unread,
Dec 9, 2015, 9:31:32 PM12/9/15
to LAStools - efficient tools for LiDAR processing, Owen Ransen
Please try this build


note that you'll need the VS12 redistribution files (MSVCR120.DLL & MSVCP120.DLL), which are not included


I'm thinking of making an application which would use laslib (above all for unzipping LAZ files) but can't find if laslib.dll is already available in 64 bit for VS2013, and where to download it.

An alternative I suppose would be to compile the DLL from the laslib sources myself. But again there are so many downloads of laslib.zip available I'm unsure which to use.

Anyway a 64 bit DLL+ lib and H file would be the ideal soution...

Howard Butler

unread,
Dec 10, 2015, 4:45:59 PM12/10/15
to last...@googlegroups.com, Evon Silvia

> On Dec 9, 2015, at 6:35 PM, Martin Isenburg <martin....@gmail.com> wrote:
>
> Hello,
>
> You can find the latest version of LASzip (including the "LAS 1.4 compatibility mode") that is linked by LASlib but also comes with a standalone DLL (that also supports the "LAS 1.4 compatibility mode") via this github link:
>
> http://github.com/LAStools/LAStools/tree/master/LASzip
>
> Once all these (backward-) compatible changes have proven over time they will also be integrated into the somewhat slower advancing version at
>
> http://github.com/LASzip/LASzip
>
> that has hisorically mainly been the repository that Howard's libLAS has been linked against. As libLAS does not handle LAS 1.4 there has been no pressing need so far to rush the latest additions (aka the "LAS 1.4 compatibility mode") into that version.

It's not just libLAS that uses laszip.org. It's also PDAL, which does fully support LAS 1.4. laz-perf, which is used to provide potree.org and plas.io's JavaScript LAZ implementations is based off of the laszip.org codebase too. There are presumably a number of commercial LAZ implementations that use the laszip.org org codebase to steer clear of the LAStools licensing ambiguity. Please don't purposefully let the laszip.org codebase lag.

Howard

Joaquim Luis

unread,
Dec 10, 2015, 8:18:47 PM12/10/15
to Martin Isenburg, LAStools - efficient command line tools for LIDAR processing, Evon Silvia
Thanks a lot.

I have LIDAR grids stored in xyz that take 5 times less space than the best netCDF deflate level (9), so I want to write a tool to save grids in laz ... in Julia language (it already sort of works). I'll say more when it will be in better shape.

Owen Ransen

unread,
Dec 10, 2015, 8:23:21 PM12/10/15
to LAStools - efficient tools for LiDAR processing, thro...@ransen.com
I have linked in the "laszip.lib" into my simple application, included "lazzip.hpp" in my source file and tested it by simply creating a LASZip object like this:

{
    LASzip LazObject ;
}

The file compiles but the linker fails. I know it can see the lib file because if I deliberately change the path to force an error I get an error.

The two things that the linker is missing is the constructor and destructor...

error LNK2019: unresolved external symbol "public: __cdecl LASzip::~LASzip(void)"
error LNK2019: unresolved external symbol "public: __cdecl LASzip::LASzip(void)"


Any pointers? I'm compiling for a 64 bit MFC Windows desktop app..

Martin Isenburg

unread,
Dec 11, 2015, 7:56:56 PM12/11/15
to LAStools - efficient command line tools for LIDAR processing, thro...@ransen.com
Hello,

the only DLL-exported symbols in the source code of LASlib are currently in these classes here:

http://github.com/LAStools/LAStools/blob/master/LASlib/inc/lasreader.hpp
http://github.com/LAStools/LAStools/blob/master/LASlib/inc/laswriter.hpp

which was apparently considered sufficient by those who have used LASlib as a DLL in the past. I think you will need to add the respective LASLIB_DLL define just like you find it in lines 52 and 150 of lasreader.hpp

class LASLIB_DLL LASreader
class LASLIB_DLL LASreadOpener

into the proper place in 

http://github.com/LAStools/LAStools/blob/master/LASzip/src/laszip.hpp

or simply make the existing LASZIP_DLL (un-)define in line 78 identical  to the LASLIB_DLL define that you can find here


That said ... I think I need to make that a little cleaner in the next release. The DLL handling needs some improvement because traditionally LASlib has only be used as a static linked library and the DLL switches for LASlib where just recently added after several complaints about them being missing. This will be cleaned up soon ...

Regards,

Martin @rapidlasso

Owen Ransen

unread,
Dec 18, 2015, 7:49:10 AM12/18/15
to LAStools - efficient tools for LiDAR processing

Does anyone have the VS2010 or VS2013 project file for creating the LasZip.Dll in 64 bit? I've not been able to manage it myself, I expect there is a setting or two I've forgotten or mistaken...

Evon Silvia

unread,
Dec 21, 2015, 11:48:32 AM12/21/15
to last...@googlegroups.com
my VS2010 solution for community use. I constructed the solution from Martin's project file a couple years ago. Because converting his project file doesn't seem to work any more, updating the solution entails replacing the source code (in the "src" folder) whenever he provides a new release. The included source dates back to mid-September, so you should probably replace the source with the latest version.

Note that the solution is currently configured to build the DLL to the "dll64" (Release) and "dll64D" (Debug) folders. I haven't configured it to build the examples. One of these I'll fork this from the GitHub source and distribute it properly.

Obviously, this is provided as-is and no warranty of success or quality is guaranteed or implied. It is your responsibility to verify that it compiles and runs correctly.

Evon
--
Quantum Geospatial Logo
Evon Silvia PLS
Geomatics Specialist
517 SW 2nd Street, Suite 400, Corvallis, OR 97333
P: (541) 452-8502
On Fri, Dec 18, 2015 at 4:44 AM, Owen Ransen <thro...@ransen.com> wrote:

Does anyone have the VS2010 or VS2013 project file for creating the LasZip.Dll in 64 bit? I've not been able to manage it myself, I expect there is a setting or two I've forgotten or mistaken...

--
Reply all
Reply to author
Forward
0 new messages