Monday, May 28, 2012

Google Mapplet for showing local coordinates

This Google Mapplet was written to show the local projected coordinates for any clicked point on Google Maps. Run it from this website http://dominoc925-pages.appspot.com/mapplets/cs_readout.html.


The mapplet currently supports only the following projection types: Cassini-Soldner, Mercator, Oblique Mercator and Transverse Mercator. The datum transformation between the WGS84 datum used by Google Maps and the local projection datum is done using the Standard Molodensky transformation. The transformation parameters of the datums and ellipsoid parameters are taken from this University of Colorado site http://www.colorado.edu/geography/gcraft/notes/datum/edlist.html.

Define and save projection parameters
There are probably hundreds of projection parameter sets in use in the world - too many to keep track. A facility has been built in using some HTML5 features to allow projection parameters to be changed, saved and named, and reuse in the current browser.


  1. In the Side bar on the right, click the Projection link.
  2. In the Projection combo box, select any default projection parameter set e.g. British National Grid.
  3. Change any parameters e.g. Longitude of origin.
  4. Click Save projection as.

    A text entry field appears.
  5. Type in a meaningful name e.g. MyProjection. Click Ok.

    The projection parameters are saved and named as MyProjection.

    Simply select the saved projection to use it for the coordinate readout

Monday, May 21, 2012

Adjust brightness and contrast of intensity images using Imagemagick

Sometimes the intensity images generated from LiDAR las files are too dark or too bright. An example of a dark intensity image is shown below.

It is useful to be able to apply some post-processing brightness and contrast adjustments to the images. Photoshop can be used to interactively adjust the brightness and contrast but I like to use the free Imagemagick open source software to process images in batch. Imagemagick has a convert utility which can perform brightness and contrast adjustments on images from the command line.

To make an intensity image brighter, type in the following at the command line prompt with the brightness-contrast option.
c:\> convert -brightness-contrast 50x20 input.tif out_lighter.tif

where the 50 tells the utility to increase the brightness by +50 and 20 is to increase the contrast by 20.



To make an intensity image darker, type in the following at the command line prompt with negative brightness and/or contrast values.
c:\> convert -brightness-contrast -30x10 input.tif out_darker.tif

where -30 is to darken by 30 and +10 is to increase the contrast by 10.

More information about the convert utility is available on this link.

Monday, May 14, 2012

Re-align a raster image to the corners in Gimp

The free and open source software Gimp is an Adobe Photoshop like software that can be used to edit or adjust raster images. If you use the Gimp software for editing raster images for contrast, brightness, color balance, etc. then it just might be possible to make a mistake and shift the entire raster image layer so that it is no longer align to the canvas corners. The screenshot below shows a shaded relief raster image that has been mistakenly shifted - the bottom right is no longer aligned to the corner.

In order to shift the raster layer back precisely, the Gimp ruler guide lines can be used as described below.

  1. In the Gimp Toolbox, click the Zoom tool and zoom closer to the corner.


  2. On the top horizontal ruler bar, press down the left mouse button and drag out a horizontal guide line until it snaps to the bottom of the canvas.


  3. On  the left vertical ruler bar, press down the left mouse button and drag out a vertical guide line until it snaps to the right of the canvas.
  4. In the Toolbox, click the Move tool. Press down the left mouse button on the raster image and drag the image so that the bottom right corner snaps  to the horizontal and vertical guide lines.

    The raster image is snapped to the canvas corner.


    The raster image is now correctly aligned again.
     

Monday, May 7, 2012

How to detect changes between two GeoMedia polygon features

Detecting changes between two polygon vector features is a common workflow in GIS especially for forestry, and land use planning. For example, it may be useful to quantify the amount of forest cover changes (loss of vegetation, or vegetation growth) between two periods of time. GeoMedia provides the spatial analysis functions that can help to detect the changes provided the polygon vegetation features for the two periods of time are available. The example below illustrates how to use GeoMedia's Spatial Difference command to identify the loss of vegetation and vegetation growth.


Identify the loss of vegetation

  1. In GeoMedia, select Analysis | Spatial Difference.

    The Spatial Difference dialog box appears.

  2. In the From features in combo box, select the later vegetation polygon feature e.g. Vegetation2012.
  3. In the Subtract features in combo box, select the earlier vegetation polygon feature e.g. Vegetation2002.
  4. In the Output difference as Query name field, type in a meaningful string e.g. Loss of Vegetation since 2002.
  5. Optional. Click the Style button and set a thick border color e.g. red.
  6. Click OK.

    The areas representing the loss of vegetation since 2002 are displayed in red.

Identify the new vegetation growth
  1. Select Analysis | Spatial Difference.

    The Spatial Difference dialog box appears.

  2. In the From features in combo box, select the later vegetation polygon feature e.g. Vegetation2012.
  3. In the Subtract features in combo box, select the earlier vegetation polygon feature e.g. Vegetation2002.
  4. In the Output differences as Query name field, type in a meaningful string e.g. New vegetation growth since 2002.
  5. Optional. Click Style and set a thick green border color.
  6. Click OK.

    The new vegetation growth areas are displayed in dark green.