Monday, November 28, 2011

Google Mapplet to readout UTM coordinates

This Google Maps tool was written to show the local Universal Transverse Mercator (UTM) easting and northing values of any clicked point on Google Maps.

To use this tool,
  1. Simply open up any Internet browser and 
  2. Go to http://dominoc925-pages.appspot.com/mapplets/cs_utm.html.
  3. Then click on any location on the map.

    An info window pops up showing the easting and northing values.
If necessary, the Standard Molodensky transformation is used to transform a position between Google Maps' WGS84 datum and the user defined reference datum. The ellipsoid and datum transformation parameters are taken from the University of Colorado site http://www.colorado.edu/geography/gcraft/notes/datum/edlist.html. 

Monday, November 21, 2011

Move a feature to another layer in Global Mapper

It is possible to move an existing geometry feature such as a polygon from one layer to another layer in Global Mapper. It is not as intuitive as it could be but it is certainly possible. Below is an example of moving a polygon from its original layer to a new layer.

  1. Start Global Mapper. Create or load and display some polygon features.

    The polygons are displayed.
  2. Press ALT+D. Press CTRL and click on one or more polygon.

    The polygon(s) are selected.
  3. Press the mouse right button anywhere inside the map view.

    A pop up menu appears.
  4. Choose Edit Selected Features.

    The Modify Selected Area Features dialog box appears.
  5. In the Feature Layer drop down list, choose another layer to move to. If a new layer is wanted, then choose Create New Layer for Feature. Press OK.

    The Enter Layer Name prompt appears.
  6. Type in a layer name, e.g. MyNewLayer. Press OK.

    The selected polygons are moved to the new layer.
  7. Press ALT+C.

    The Overlay Control Center dialog box appears.
  8. Toggle on/off the new layer MyNewLayer.

    The polygons on MyNewLayer are displayed/hidden.

Monday, November 14, 2011

C# code snippet to read an Applanix SBET file

The smoothed best estimated trajectory (SBET) file of an air survey flight created and exported by the Applanix PosPac software is a simple binary format. The SBET file is just a series of records with the following double fields, as described by the C# code below:

public class SbetRecord
{
    public double time;    //GPS seconds of week
    public double latRad;    //latitude in radians
    public double lonRad;    //longitude in radians
    public double alt;    //altitude
    public double xVel;    //velocity in x direction
    public double yVel;    //velocity in y direction
    public double zVel;    //velocity in z direction
    public double roll;    //roll angle
    public double pitch;    //pitch angle
    public double heading;    //heading angle
    public double wander;    //wander
    public double xForce;    //force in x direction
    public double yForce;    //force in y direction
    public double zForce;    //force in z direction
    public double xAngRate;    //angular rate in x direction
    public double yAngRate;    //angular rate in y direction
    public double zAngRate;    //angular rate in z direction
}

Then just use a BinaryReader to open up the file and read in the fields as doubles as shown in the code snippet below.
SbetRecord rec = new SbetRecord();
// Open an SBET file for reading...
BinaryReader reader = new BinaryReader(File.Open(@"C:\Temp\sbet1.out", FileMode.Open, FileAccess.Read));
 
// ...read a record...
rec.time = reader.ReadDouble();
rec.latRad = reader.ReadDouble();
rec.lonRad = reader.ReadDouble();
rec.alt = reader.ReadDouble();
rec.xVel = reader.ReadDouble();
rec.yVel = reader.ReadDouble();
rec.zVel = reader.ReadDouble();
rec.roll = reader.ReadDouble();
rec.pitch = reader.ReadDouble();
rec.heading = reader.ReadDouble();
rec.wander = reader.ReadDouble();
rec.xForce = reader.ReadDouble();
rec.yForce = reader.ReadDouble();
rec.zForce = reader.ReadDouble();
rec.xAngRate = reader.ReadDouble();
rec.yAngRate = reader.ReadDouble();
rec.zAngRate = reader.ReadDouble();
 
// ... etc ...

Monday, November 7, 2011

Clip a polygon with another polygon using Global Mapper

In GIS data editing work, it may be useful to clip a polygon with another polygon in a simple boolean operation. Global Mapper can perform the clipping task using the Cut Selected Area(s) from another Area (Add Islands) function. The example below illustrates a simple polygon clipping procedure:
  1. Start Global Mapper. Load or create at least two overlapping polygons.


  2. Press ALT+D.

    The Digitizer Tool is activated.
  3. Move the cursor to the polygon to be used as the clipper. Click on the polygon.

    The polygon is selected.
  4. Press the mouse right button anywhere in the map view.

    A pop up menu appears.

  5. Choose Cut Selected Area(s) from Another Area (Add Islands).

    The prompt appears: Select the Area to use as the Parent for this island, Esc to cancel.
  6. Move the mouse to the polygon to be clipped. Click on the polygon.

    The prompt below appears.
  7. Click Yes.

    The polygon is clipped.