How To Create Garmin Topo Maps - Part 5 - Points of Interest

Author: Dan Blomberg | Last updated March 21st, 2016 at 01:01pm

Introduction

The 4th part of this tutorial details where to get and how to process points of interest data.  This includes airports, summits, towns, rapids, etc.  In this tutorial we will download thousands of points of interest that would normally be included on topographic maps.  The data comes from the USGS Geographic Names Information System (GNIS).

Downloading The POI Data

As time has passed the process for getting the GNIS data has changed.  As with most of the other features this data has been rolled into the USGS National Map as well.

  1. Open the National Map Viewer (Download version)
  2. On the left click the box for "Names - Geographic Names Information System (GNIS)"
  3. For Data Extent select State
  4. Now zoom in to the state you want.
  5. Click the draw point button and draw a point inside the state
  6. With the point drawn click Find Products in the left pane.
  7. Click Download to download the GNIS file for your state.

Converting to Shapefile

The ASCII text file must be converted into a shapefile so that we can process it.  This can be done with QGIS or Global Mapper.

QGIS

  1. Open QGIS
  2. Select Layer > Add Layer > Add Delimited Text Layer...
  3. For filename select the GNIS text file.
  4. Change the layername to GNIS
  5. For file format select "Custom delimeters"
  6. Uncheck the tab box and put a | in the other delimiters box
  7. Make sure the "First record has field names" is checked
  8. With "Point coordinates" selected as the geometry definition set the X field to "PRIM_LONG_DEC" and the Y field to "PRIM_LAT_DEC"
  9. Click OK
  10. For coordinate reference system select NAD83
  11. Click OK
  12. In the Layers panel right click on GNIS and select Save As
  13. Hit Browse in the Save As box and save the file as GNISnocut.shp
  14. Hit OK
  15. Now click on the new gnis layer and then open the Table Manager
  16. Select the feature_NA column and rename it NAME
  17. Select the feature_cl column and rename it layer
  18. Select the following columns (hold CTRL to select them all at once): FEATURE_ID, STATE_ALPH, STATE_NUME, COUNTY_NAM, COUNTY_NUM, PRIMARY_LA, PRIM_LONG_, SOURCE_LAT, SOURCE_LON, SOURCE_L_1, SOURCE_L_2, ELEV_IN_M, MAP_NAME, DATE_CREAT, DATE_EDITE and click Delete
  19. Click Save
  20. Click yes to save the layer style.
  21. Close the table manager.
  22. Now some of the points will likely be outside the state even though they shouldn't be, we need to fix this. Add the vector layer GU_StateOrTerritory.shp file modified back in part 1 (Layer > Add Layer > Add Vector Layer...)
  23. Go to Vector > Geoprocessing Tools > Clip
  24. For the input layer select GNISnocut and for the clip layer select GU_StateOrTerritory
  25. For output file hit Browse and call the file gnis
  26. Click OK. This could take a long time so be patient.
  27. You can now exit QGIS; the file is ready.

Global Mapper

  1. Open Global Mapper
  2. Click File > Open Data Files
  3. Select the GNIS features text file and click open
  4. It will give you a message about how much GNIS data it imported.
  5. Click File > Export > Export Vector Format...
  6. For the type select "Shapefile"
  7. Click OK
  8. Click OK if you get a projection message.
  9. Click the export points check box
  10. Name the file gnis and put it in your gnis folder
  11. Click OK
  12. You can now exit Global Mapper; the file is ready.

Processing the Data

This step involves deleting the information we don't need and setting the MP_TYPE so that it can, in the future, be converted into a MP then img file. This will be done with PostGIS.

Load the Data into PostGIS

  1. Open pgadmin III (in the start menu)
  2. Double click the PostgreSQL database to connect to it. Enter the password if required.
  3. Expand databases
  4. Click on postgis to access/initialize that database.
  5. Expand postgis
  6. Expand Schemas
  7. Expand public
  8. Expand Tables
  9. Make sure that you don't currently have a gnis table. If you do, right click it and select Delete/Drop
  10. Now go to the Plugins menu and select "PostGIS Shapefile and DBF Loader 2.2"
  11. In the Import tab click "Add File"
  12. Select the gnis.shp file and click Open
  13. Click Import
  14. If you run into an error follow the steps shown in the log window.  I had to select options and change my type of LATIN1 for some of the files.
  15. Close the PostGIS Shapefile Import/Export manager.

Process the Data

  1. Still in pgAdmin III right click on tables and select refresh.
  2. You should now see a new table: mergededges
  3. Click the SQL query button.
  4. Enter the following query:
    ALTER TABLE gnis ADD COLUMN MP_TYPE character varying(50);
    ALTER TABLE gnis ALTER COLUMN MP_TYPE SET STORAGE EXTENDED;
    UPDATE gnis SET MP_TYPE = '0x2F04' WHERE layer LIKE 'Airport';
    UPDATE gnis SET MP_TYPE = '0x6601' WHERE layer LIKE 'Arch';
    UPDATE gnis SET MP_TYPE = '0x6602' WHERE layer LIKE 'Area';
    UPDATE gnis SET MP_TYPE = '0x6501' WHERE layer LIKE 'Arroyo';
    UPDATE gnis SET MP_TYPE = '0x6502' WHERE layer LIKE 'Bar';
    UPDATE gnis SET MP_TYPE = '0x6603' WHERE layer LIKE 'Basin';
    UPDATE gnis SET MP_TYPE = '0x6503' WHERE layer LIKE 'Bay';
    UPDATE gnis SET MP_TYPE = '0x6604' WHERE layer LIKE 'Beach';
    UPDATE gnis SET MP_TYPE = '0x6605' WHERE layer LIKE 'Bench';
    UPDATE gnis SET MP_TYPE = '0x6504' WHERE layer LIKE 'Bend';
    UPDATE gnis SET MP_TYPE = '0x6401' WHERE layer LIKE 'Bridge';
    UPDATE gnis SET MP_TYPE = '0x6505' WHERE layer LIKE 'Canal';
    UPDATE gnis SET MP_TYPE = '0x6606' WHERE layer LIKE 'Cape';
    UPDATE gnis SET MP_TYPE = '0x6403' WHERE layer LIKE 'Cemetery';
    UPDATE gnis SET MP_TYPE = '0x6506' WHERE layer LIKE 'Channel';
    UPDATE gnis SET MP_TYPE = '0x6404' WHERE layer LIKE 'Church';
    UPDATE gnis SET MP_TYPE = '0x6607' WHERE layer LIKE 'Cliff';
    UPDATE gnis SET MP_TYPE = '0x6406' WHERE layer LIKE 'Crossing';
    UPDATE gnis SET MP_TYPE = '0x5500' WHERE layer LIKE 'Dam';
    UPDATE gnis SET MP_TYPE = '0x6508' WHERE layer LIKE 'Falls';
    UPDATE gnis SET MP_TYPE = '0x660B' WHERE layer LIKE 'Gap';
    UPDATE gnis SET MP_TYPE = '0x650B' WHERE layer LIKE 'Harbor';
    UPDATE gnis SET MP_TYPE = '0x3002' WHERE layer LIKE 'Hospital';
    UPDATE gnis SET MP_TYPE = '0x650C' WHERE layer LIKE 'Island';
    UPDATE gnis SET MP_TYPE = '0x650D' WHERE layer LIKE 'Lake';
    UPDATE gnis SET MP_TYPE = '0x660E' WHERE layer LIKE 'Lava';
    UPDATE gnis SET MP_TYPE = '0x640A' WHERE layer LIKE 'Locale';
    UPDATE gnis SET MP_TYPE = '0x640C' WHERE layer LIKE 'Mine';
    UPDATE gnis SET MP_TYPE = '0x640E' WHERE layer LIKE 'Park';
    UPDATE gnis SET MP_TYPE = '0x6610' WHERE layer LIKE 'Plain';
    UPDATE gnis SET MP_TYPE = '0x0D00' WHERE layer LIKE 'Populated Place';
    UPDATE gnis SET MP_TYPE = '0x6611' WHERE layer LIKE 'Range';
    UPDATE gnis SET MP_TYPE = '0x650E' WHERE layer LIKE 'Rapids';
    UPDATE gnis SET MP_TYPE = '0x650F' WHERE layer LIKE 'Reservoir';
    UPDATE gnis SET MP_TYPE = '0x6613' WHERE layer LIKE 'Ridge';
    UPDATE gnis SET MP_TYPE = '0x2C05' WHERE layer LIKE 'School';
    UPDATE gnis SET MP_TYPE = '0x6615' WHERE layer LIKE 'Slope';
    UPDATE gnis SET MP_TYPE = '0x6511' WHERE layer LIKE 'Spring';
    UPDATE gnis SET MP_TYPE = '0x6616' WHERE layer LIKE 'Summit';
    UPDATE gnis SET MP_TYPE = '0x6513' WHERE layer LIKE 'Swamp';
    UPDATE gnis SET MP_TYPE = '0x6411' WHERE layer LIKE 'Tower';
    UPDATE gnis SET MP_TYPE = '0x6412' WHERE layer LIKE 'Trail';
    UPDATE gnis SET MP_TYPE = '0x6413' WHERE layer LIKE 'Tunnel';
    UPDATE gnis SET MP_TYPE = '0x6617' WHERE layer LIKE 'Valley';
    UPDATE gnis SET MP_TYPE = '0x6414' WHERE layer LIKE 'Well';
    DELETE FROM gnis WHERE MP_TYPE IS NULL;
  5. Click execute query
  6. If you would like to have the elevation after the summit such as "Bailey Butte, 7644ft" also execute this SQL query:
    UPDATE gnis SET "name" = concat("name",', ',ELEV_IN_FT,'ft') WHERE layer LIKE 'Summit' AND ELEV_IN_FT IS NOT NULL;
  7. Close the SQL window.

Export the Data

  1. With pgAdmin III still open go to the Plugins menu and select "PostGIS Shapefile and DBF Loader 2.2"
  2. Click the export tab
  3. Click "Add Table"
  4. Select gnis and click OK
  5. Click "Export"
  6. Go to the folder where your gnis data is stored and click "Open". This will overwrite the old points of interest (gnis.shp) data and replace it with the modified data.
  7. Once the export is complete close the Loader
  8. To save space and not make a mistake later, in pgAdmin III delete the table. Right click on gnis and click Delete/Drop.

What's Next?

Next we will get all the different types of Federal Lands from reservations and national parks to military bases.

<-- Previous - Transportation Data | Table Of Contents | Next - Federal Lands -->