Saturday, November 28, 2009

Export GeoMedia features and queries to ASCII text file

There is a useful extension to GeoMedia on the Intergraph support web site to unload geometry and attribute information to ASCII text files; it's called the ASCII Unloader. It is free but you need to login first before you can download and install the extension. I use if fairly frequently to take GeoMedia features and queries into another software package like Global Mapper. Once the ASCII Unloader extension is installed, there would a new ASCII Unloader entry to the Extensions pulldown menu within GeoMedia or GeoMedia Professional as shown below.

Using the ASCII Unloader is straightforward and the steps are generally self-explanatory as described below.
  1. In GeoMedia, select Extensions > ASCII Unloader.

    The ASCII Unloader - Output File Format dialog box appears.


  2. In the Features/Query to Unload drop down list, choose the desired feature or query e.g. Interstates feature.

  3. Next, in the Output filename field, click Browse.

    The Save Output ASCII File dialog box appears.

  4. Type in the output filename e.g. C:\Warehouses\Interstates.txt.Click Save.



  5. At this point, you can click Next if the default Output File Format settings are okay. Otherwise, you simply go to the appropriate fields and change e.g. from Comma Delimited to Space Delimited, or toggle on the Field names on first line, etc. A sample of how the changes affect the output file is shown in the Quick View box.

  6. Click Next.

    The Attributes to Output appear.


  7. In the Available attributes list, double click on the attributes you want to output.

    The attributes are selected and displayed in the Selected attributes list.

  8. In the Units & Precision list, select the type of the coordinates e.g. Projection.

  9. In the Available coordinates list, double click on the type to output e.g. Easting and Northing.

    The items are displayed in the Selected coordinates list.


  10. At this point, to see a sample of how the output file will look like, click View First 25 Records.

    The View Format dialog appears.


  11. Click Close. If necessary, change any settings you want.

  12. Click Apply.

    The ASCII text file is created.


Friday, November 20, 2009

Flagging dangles (free end points) with FME



FME has many transformers that you can mix and match to perform almost any kind of spatial data validation. A common task in data validation is to identify unconnected end points (commonly known as dangles or free end points) in the line work. In the sample data shown below, there are 5 dangles among the 8 vertices of the line work.

To get FME to identify the dangles, I used the Workbench to define the following transformation.

The steps are described below.
  1. Start the FME Workbench and open a blank workspace.

  2. Select Source Data > Add Dataset to add in a source dataset.

    For this example, I added in a ESRI shape file as the source dataset.


  3. Select Destination Data > Add dataset to add in a destination dataset.

    I chose to output the dangle flags as ESRI Shape point file.




  4. Drag and drop the following transformers onto the workbench:
    - CoordinateFetcher (2 times)
    - GeometryRemover
    - 2DPointAdder
    - Matcher

  5. Connect the transformers with the source and destination datasets as shown below.



  6. Open up the first CoordinateFetcher's properties.In the Index field, type in 0. Click OK.



    Note: this transformer will extract the line work's first vertex into the fields _x, _y, and _z.

  7. Open up the second CoordinateFetcher's properties. In the Index field, type in -1. Click OK.



    Note: this transformer will extract the last vertex of the line feature into the fields _x, _y, _z.

  8. Open up the 2DPointAdder transformer's properties. In the X-Value field, choose _x. In the Y-Value field, choose _y. Click OK.



    Note: the 2DPointAdder will create a new point from the _x and _y fields.

  9. Open up the Matcher transformer's properties.In the Match Geometry field, choose 2D.

    Note: In this example, in the Attribute(s) to match field, I chose _x, _y but this is redundant because the 2D point geometry already has the _x and _y coordinates. This field can be left blank.



  10. Run the translation.

    The dangles are created and flagged as red crosses below.


Friday, November 6, 2009

Finding out the digitized direction with a line style

In some GIS applications, it is necessary for the lines to be digitized in a certain direction. For example, in terrain modelling, lines representing drainage lines should be digitized from up to downstream. A simple trick to find out the direction of the digitized lines is to display an arrow head. I found Global Mapper to be very easy to assign a directional arrow line style to line features. All you have to do is define a new line type with the directional arrow style, then assign the line type to your line features.

  1. In Global Mapper, select Tools > Configure.

    The Configuration dialog box appears.


  2. Click the Line Styles tab if it is not active. Click New Type.

    The Setup Line Type Information dialog box appears.

  3. In the Type Name field, type in a name e.g. DigitizeDirection.

  4. In the Style drop down list, scroll down with the arrow down key and observe the sample display. Choose the style that has the arrow pointing to the right, e.g. Solid with Arrow P... (Sorry the name is too long to read from the dialog box).



  5. Click OK.

    The new line type is added.


  6. Click OK.

Now you can assign this line type to new or existing line features. If you digitize a new line feature, the following dialog box will pop up at the end of the digitizing.

In the Feature Type drop down list, choose the new line type created earlier e.g. DigitizeDirection. Click OK. As shown in the figure below, the line feature is stylized with an arrow head pointing in the digitized direction.


If the direction is incorrect, then you need to reverse the order of the line feature's vertices.