Thursday, May 21, 2009

Import Text File as area polygons in Global Mapper

Sometimes I have ASCII text files that contain XY coordinates defining the outline of polygons. An example is my polygoncoords.txt file shown in the figure below. Typically it has the polygon vertices listed from the first point to the last point, with the last point having the same XY coordinates as the first point. 
It is not clear how you can load this kind of polygon ASCII text file in Global Mapper as area geometry features. If you use the Global Mapper's Open Generic ASCII Text File command, it will be loaded as a line vector feature. I had to dig around before I found out how to load it as a polygon vector feature. Here is how I did it.
  1. Open up the polygon ASCII text file in your favorite text editor and add in the following line at the top:

    CLOSED = YES



    Note: I also added NAME=My Polygon in the example above. This line simply tells Global Mapper to create and display the label "My Polygon".

  2. Close and save the text file.

  3. In Global Mapper, select File > Open Generic ASCII Text File(s).

    The Open dialog box appears.


  4. In the Open dialog box, browse or type in the polygon ASCII text file in the File name field. Click Open.

    The Generic ASCII Text File Import Options dialog box appears.


  5. In the Generic ASCII Text File Import Options dialog box, ensure that the Point, Line, and Area Features option is on. Click OK

    The Select Projection for dialog box appears.


  6. Define an appropriate coordinate system. Click OK.

    The area vector feature is created and displayed in Global Mapper.


  7. If you use the Tools > Feature Info tool and click on the polygon, the polygon is highlighted as shown in the figure below. Note that the Feature Information dialog is showing that the Feature Type is an area type. 

No comments:

Related Posts with Thumbnails