Thursday, May 7, 2009

Defining a Text File Server format file for GeoMedia

GeoMedia can read text files (such as the simple CSV file shown in the screenshot below) directly through the Text File Connection. 
But before you can connect to the text file, you have tell GeoMedia how the text file is formatted or structured i.e. you have to define the name of the field, the data type of the field, geometry type if any etc. This post describes the steps to create a text file server format using GeoMedia's Define Text File Server Format File Utility.
  1. On the Windows desktop, select Start > All Programs > GeoMedia > Utilities > Define Text File Server Format File.

    The Define Text File Server Format dialog box appears.


  2. Select File > New.

    The New dialog box appears.

  3. Choose normal.tfd. Click New.

    The Define Text File Server Format - File Type Definition dialog box appears.


  4. Click Browse. Note: we want to see a sample of our text file to help in the definition process. 

    The TFD Open Text File dialog box appears.


  5. Browse and select the text file we want to read in GeoMedia, e.g. mytextfile.csv. Click Open

    The text file is previewed in the Text file preview box.


  6. In the Geometry type drop down list, choose None.

    Note: if your text file contains point geometry records, then choose Point. Later you have to define the X and Y geometry fields. In this example, I'll go with no geometry


  7. If your text file has a header row, enter 2 in the Start row field to skip the header row. 

    The Define Text File Server Format - File Type Definition dialog box may look like this at this point.


  8. Click Next

    The Define Text File Server Format - Delimited Data Definition page appears.

  9. If the data is comma delimited, toggle on Comma.



  10. Click Next.

    The Define Text File Server Format - Geometry Definition - Points page appears. Note that the first preview column is marked with a check icon

  11. In the attribute name field, clear the text "skip" and enter a meaningful name for the field, e.g. id. Click Set attribute definition.

  12. Click the second column header. In the attribute name field, clear "skip" and enter the field name e.g. Easting. In the attribute data type field, choose Double. Click Set attribute definition

  13. Repeat the previous step 12 for the remaining columns, if any.

  14. Click Finish.

    The Message "Do you want to save the changes you made to 'Untitled.tfd'?" appears.

  15. Click Yes.


  16. In the File name field, enter a file name. Click Save.

    The Text file server format definition is created and can be used when connecting to this text file in GeoMedia. 





1 comment:

Unknown said...

what if it is a line not a point?