USGS TNM Style Map Template - ArcGIS

While I'm still on the topic of USGS topo maps, I wanted to say how excited I am about the USGS Topo TNM Style Template. You can use this template to re-create a GIS ready USGS topographic styled maps. The Topo TNM Style Template is currently only available as an ArcGIS 10.x map document (mxd).

More information on the TNM Style Template can be found at http://viewer.nationalmap.gov/tools/topotemplate. You can download a zipped demo file, which includes a document on how to use the map template and tailor it to your area of interest. 

The template is recommended for used with Topo Map Vector Data products, which are still under production. The last I checked (5/21/2016) for available data for Hawaii, only staged data for the Ewa quad is available to use with the TNM Style Template. However, I was able to download other publicly available data and use them in the template. It's not perfect but it still looks very much like the current USGS topo maps in GIS ready format. I've included some sample images of what the map template I've tailored for Hawaii looks like.

USGS staged TNM data available for Hawaii, last checked on 5/21/2016 - only data for Ewa quad is available.A

USGS staged TNM data available for Hawaii, last checked on 5/21/2016 - only data for Ewa quad is available.A

Figure 1: TNM mxd displayed in ArcGIS layout view. Notice the similarity to a printed USGS topo map.

Figure 1: TNM mxd displayed in ArcGIS layout view. Notice the similarity to a printed USGS topo map.

Figure 2: TNM mxd as displayed in ArcGIS data view. This is similar to a printed topo map.

Figure 2: TNM mxd as displayed in ArcGIS data view. This is similar to a printed topo map.

How to convert geopdf to geotiff using GDAL

This tutorial shows you how to convert USGS geoPDF topo maps to geoTiffs using GDAL. It assumes that you have: 1) downloaded some USGS geopdfs, 2) a pdf reader such as Adobe Acrobat, and 3) GDAL installed on your computer. Below are the steps I used in converting USGS topo maps from geopdfs to geotiffs with GDAL. I am accessing GDAL using OSGeo4W Shell utility.  The OSGeo4W installer bundles a set of open source geospatial software (e.g. QGIS, GDAL/OGR, GRASS, etc.) for the Windows OS environment. For more information, see website at https://trac.osgeo.org/osgeo4w/.

The USGS has a good, detailed document on how to convert GeoPDF to Geottiffs using GDAL and other software. It can be found here at http://nationalmap.gov/ustopo/documents/ustopo2gtif_current.pdf.

The steps below is the workflow I used to convert a USGS geopdf topo map to geotiff. For a more detailed, step-by-step instruction see the pdf tutorial, How to Convert GeoPDF to GeoTIFF Using GDAL. The method shown here will not create a collarless geotiff image. It will convert a geodpf to geotiff without the collar information but will not actually clip the collar off. 

Step 1: Open OSGeo4W Shell and PDF Layer Names

  • Open the OSGeo4W Shell. It should look something like the image below.

Figure 1: OSGeo4W Shell

Figure 1: OSGeo4W Shell

  • Navigate to your drive and directory where your GeoPDFs are stored, by using the cd or change directory command and inputting your own parameters where denoted by < >.

cd <your drive letter>:\<path to directory>

  • To get a list of files in the directory, type in dir 

  • To get information about your pdf, including coordinate system and pdf layer names, type in gdalinfo <GeoPDF filename> -mdd layers

Step 2: Convert a single geoPDF to geoTIFF

To convert a single geopdf to geotiff, use the gdal_translate command and input your own parameters where denoted by < >. You can use gdal_translate with or without optional parameters. 

Option 1: gdal_translate <geopdf filename> <output geotiff filename> -of GTiff

Example: gdal_translate HI_Honolulu_20130410_TM_geo.pdf HonoluluTopo.tif -of GTiff 

Note: This option will convert all pdf layers to a geotiff at 96dpi. It can take a long time to process and the resulting tiff can be really large especially when including the orthoimagery and shaded terrain. I did a test on the Honolulu quad and it took maybe 3-4 hours with the resulting tiff being ~955MB. 

Option 2: Gdal_translate <GeoPDF filename> <Output Geotiff Filename> -of GTiff
--config gdal_pdf_layers_off “<pdf layername 1>,<pdf layername 2>,<pdf layername 3>” –-config gdal_pdf_dpi <output dpi>

Example: gdal_translate HI_Honolulu_20130410_TM_geo.pdf HonoluluTopo.tif -of GTiff --config GDAL_PDF_LAYERS_OFF “Map_Collar, Map_Frame.Projections_and_Grids, Map_Frame.Terrain.Shaded_Relief, Images.Orthoimage” --config GDAL_PDF_DPI 100

Step 3: Convert multiple geopdfs to geotiffs using batch file

Create a batch file to convert multiple geopdfs to geotiffs. You'll need a text editor such as Notepad. Enter the following into Notepad and save as a *.bat file.

@echo=on
SETLOCAL EnableDelayedExpansion
FOR /F %%i IN (‘DIR /B *.pdf’) DO (        
SET infile=%%i
SET outfile=!infile:.pdf=.tif!

Gdal_translate <GeoPDF filename> <Output Geotiff Filename> -of GTiff
--config gdal_pdf_layers_off “<pdf layername 1>,<pdf layername 2>,<pdf layername 3>” –-config gdal_pdf_dpi <output dpi>
)

Example: Notepad file saved as *.bat

batchfile.jpg

Step 4: Run the batch file in oSGeo4W Shell

Open up the OSGeo4W Shell and navigate to your directory where your geopdfs and the batch file are stored. Then use the TAB key to scroll through the files in your directory to select the batch (*.bat) file. Hit ENTER key when you the *.bat file selected. This will loop through all the geopdfs in the folder and convert them to geotiffs. 

After the conversion process you can then clip the geotiffs with its corresponding USGS 7.5 minute grid cells either in ArcGIS, QGIS or another GIS software. Make sure the grid cell layer is in the same coordinate system as your geotiffs before you do the clipping procedure.

The images below show examples of the Honolulu and Koko Head topo quads as they are viewed in QGIS after having the collars clipped off.

Example of Honolulu and Koko Head topo quad geotiffs with the corresponding USGS 7.5 minute grid cells as displayed in QGIS.

Example of Honolulu and Koko Head topo quad geotiffs with the corresponding USGS 7.5 minute grid cells as displayed in QGIS.

Example of Honolulu and Koko Head topo quad geotiffs without the USGS 7.5 minute grid cells as displayed in QGIS. Notice it is almost seamless -- you could get a seamless image by creating a mosaic and blending the edges.

Example of Honolulu and Koko Head topo quad geotiffs without the USGS 7.5 minute grid cells as displayed in QGIS. Notice it is almost seamless -- you could get a seamless image by creating a mosaic and blending the edges.