Monday, October 29, 2012

Add coordinate attributes to points in Global Mapper

Sometimes for whatever reason it is useful to convert the point geometry X and Y vertices as database attributes so that they can be manipulated just like any other database attributes. It is simple to do this in Global Mapper. This is illustrated in the example below.

  1. Start Global Mapper. Load in a point geometry layer.

  2. Optional. Select Tools | Feature Info. Click on any point.

    The Feature Information dialog box appears.

    Note: there are no database attribute fields for the vertices.
  3. Select Tools | Digitizer.

    The digitizer tool is activated and the cursor becomes a cross-hair with the label EDIT.
  4. Click and drag a rectangle to select one or more points.

    The selected points are highlighted in red.

  5. Press the mouse right button.

    A pop up menu appears.

  6. Choose Attribute Functions | Add coordinate attributes to selected points.

    The X,Y coordinates are added to the point attributes. A message box appears.

  7. Close the message box.
  8. Optional. Select Tools | Feature Info. Click on one of the points.

    The Feature Information dialog box appears.

    Note: the X,Y coordinate attribute fields are now displayed.

Monday, October 22, 2012

A faster alternative to the Android SDK Emulator to test apps

If you have done any development for the Android platform, then you would probably have found the Android SDK emulator to be very slow sometimes for the newer Android OS versions - Ice Cream Sandwich or Jelly Bean, especially if no snapshot is used. Recently, AMD and BlueStacks released the BlueStacks Android Player that can run Android apps on Windows. It can be downloaded from

The player can run apps at a more reasonable speed than the emulator on my aging notebook. Since it runs faster, I spend less time waiting and therefore it gives me better productivity in testing my Android apps. On the other hand, you cannot step through your Android code interactively and debug your Android application. To do that, you still have to use the Eclipse IDE and the Android SDK's emulator or an actual physical Android handset.

The following screenshots show how an Android APK file can be installed into the BlueStacks Android Player.
  1. First, start up the BlueStacks Player by selecting Start | All Programs | BlueStacks | Start BlueStacks.

    The AMD AppZone Player, Powered by BlueStacks application appears.
  2. Use the Windows Explorer and browse to the folder containing an Android APK file.

  3. Double click on it.

    The Android app is installed into the BlueStacks Player.
  4. If you don't see it in the player, then click the My Apps icon.

Monday, October 15, 2012

Merge LiDAR LAS files using FME

If you want to merge multiple LiDAR LAS files into a single, combined file, then it is possible to use the Safe FME Workbench to quickly put together a simple workflow to do the job. All that is required is to define a Reader for the multiple LAS files, connect that to the PointCloudCombiner transformer and output to a LAS file Writer. The following illustrates the steps.

  1. Start the FME Workbench.
  2. Select Readers | Add Reader.

    The Add Reader dialog box appears.

  3. In the Format field, choose ASPRS Lidar Data Exchange Format (LAS).
  4. In the Dataset field, click the browse [...] button. Select two or more LAS files. Click OK.

    The Reader is added to the Main pane.
  5. From the Transformer Gallery pane, drag and drop the PointCloudCombiner transformer onto the Main pane.
  6. Select Writers | Add Writer.

    The Add Writer dialog box appears.

  7. In the Format field, choose ASPRS Lidar Data Exchange Format (LAS).
  8. In the Dataset field, click the browse [...] button and define the output folder.
  9. Click OK.

    The following prompts will appear. Click Yes and OK.

  10. Connect the Reader, transformer and Writer as shown.

  11. Run the translation.

    The LAS files are merged into a single file.

Monday, October 8, 2012

Calculate the difference between ground control points and a DEM using Global Mapper

Somebody asked me how to find out the elevation difference between the digital elevation model (DEM) and independently surveyed ground control points (GCP). Any terrain software such as Global Mapper should have the tools to calculate the differences. In this post, I shall illustrate the steps to use Global Mapper to find out the elevation differences.

It is not as straightforward as other software as there is no single tool in Global Mapper. Basically, the DEM and the ground control points layer must be loaded together first; then the DEM elevation under the control point must be added to the GCP layer as an ELEVATION database attribute field. With the database attributes having the GCP elevation and DEM elevation fields, a database field subtraction can be done to calculate the difference between the DEM elevation and the GCP elevation.

Load the DEM and GCPs

  1. Start Global Mapper. Load in a DEM layer e.g. dtm.asc.

  2. Load and display the vector GCP layer e.g. gcp.shp.

  3. Optional. Select Search | Search by Attributes, Names, and Description.

    The Search by Attributes, Names, and Description dialog box appears.

    Note the GCP elevation field e.g. GPS_ELEVAT

Append the DEM elevation to the GCP
  1. Select File | Export Vector Format.

    The Select Export Format dialog box appears.
  2. Choose a format e.g. Shapefile. Click OK.

    The Shapefile Export Options dialog box appears.
  3. Toggle on Generate 3D Features Using Loaded Elevation data.
  4. Toggle on Export Points.

    The Save As dialog box appears.
  5. Type in the new GCP layer name e.g. gcp_dsm_accuracy.shp. Click Save.

    The GCP layer is exported out to a new vector file. The DEM elevation for each GCP point is appended to the output file
  6. Press ALT+C.

    The Overlay Control Center dialog box appears.
  7. Select the loaded GCP layer e.g. gcp.shp. Click Close Overlay.

    The GCP layer is unloaded

Calculate the difference between GCP and DEM elevations
  1. Load in the GCP layer appended with the DEM elevations exported previously e.g. gcp_dsm_accuracy.shp.

  2. Press ALT_C.

    The Overlay Control Center appears.

  3. Right click on the GCP layer.

    A pop up menu appears.

  4. Choose CALC_ATTR.

    The Setup Attribute Calculation dialog box appears.
  5. In the Select Existing or Create New Attribute to Assign Calculated Values to field, type in a name e.g. hgtdiff.
  6. In the Source Attribute field, choose the GCP elevation field, e.g GPS_ELEVAT.
  7. In the Operation field, choose Subtract.
  8. Toggle on Use Attribute Value. Choose the DEM elevation field e.g. ELEVATION.

  9. Click OK.

    The differences are calculated and inserted into the hgtdiff field.

    The Feature Information dialog box below shows the new field with the calculated difference for one of the GCP feature.

Monday, October 1, 2012

WebApp tool to apply coordinate transformation to raster world files

It is possible to perform coordinate transformation to raster files with associated ESRI world files by multiplying the matrix described in the world files with the transformation matrices (translation, rotation, scaling). An implementation of this is a simple Javascript web app at this site

To use the web app to apply coordinate transformations to one or more raster files, just do the following:
  1. In the sidebar on the right, define the transformation parameters - the x and y translation offsets, the scale factor, the rotation angle (positive clockwise), and the rotation/scaling origin.
  2. Then either drag and drop the ESRI world files (*.tfw, *.pgw, *.jgw, etc.) onto the dashed box area. Or click the button and select one or more ESRI world files.

    The source world files are read and transformed. The resultant matrices are displayed in the browser page.
  3. Copy and paste the resultant matrix into a text editor. Save as a file with the same name as the original world file.

  4. To see the transformation results, simply display the raster file in a GIS software that recognized world files e.g. Global Mapper.