Monday, March 28, 2011

FME Desktop 2011 comes with a bunch of revamped transformers designed to work with point clouds - specifically LiDAR datasets. In previous versions, FME can only read in LiDAR LAS files but I'm thrilled with this new version now since it comes with a LAS file writer.

I tried out the new point cloud transformers by performing one of the standard LiDAR processing production tasks - thinning the data by resampling at every nth point. It is simple to build a transformation workspace to do the job. Here are the steps:

Start up FME Workbench 2011.

Click Blank Workspace.

From the Windows Explorer, drag a LAS file and drop it onto the FME Workbench Main pane.The Add Reader dialog box appears.

Click OK.

Activate the Transformer Gallery tab on the left.

Find and select the PointCloudThinner transformer in the Transformer Gallery tree list. Drag and drop it onto the Main pane.

Monday, March 14, 2011

I wanted to simplify a polygon of a LiDAR flight coverage strip by removing all the holes (inner polygons in gvSIG terminology) within the polygon. I could not find a ready function other than the Delete Vertex command. Using this would be very tedious for hundreds of holes. So I thought of using gvSIG's Geoprocessing Tools to do the job. The idea is (1) to decompose the polygon and its holes into lines, (2) to remove all the short lines except the longest line and optionally to simplify the line work, and (3) to make a polygon from the remaining line.

Decompose the Polygon into Lines

Start up gvSIG OADE 2010. Add a polygon with holes layer e.g. polygonholes.shp to the view.

Monday, March 7, 2011

Recently I tried to write a C++ program for reading a LiDAR LAS file using Microsoft Visual Studio and the open source library liblas. I followed the sample tutorial from the liblas.org web site. The simple code below simply opens up a LAS file and creates a LASReader class. Compiling the simple code is okay but when I ran it, the program crashed when trying to create the LASReader class. What was the problem?

The source code is simple enough and the syntax is correct. After some research I found out that the liblas.lib file I was linking was a released (non-debug) version while I was compiling a debug version of my C++ executable. Due to licensing issues, libLAS can only be distributed in released version. If you want to compile a debug executable, then you have to download the liblas source code and compile your own debug liblas.lib. Otherwise, you can only build release copies of your executable.