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.

How to convert geopdf to geotiff using ArcGIS

Finally! After many years, the new release of ArcGIS Dekstop 10.4 now supports conversion of USGS geopdf topo quads to geotiffs.  ArcGIS 10.3.1 had support for geopdf conversion, but it did not work on USGS topos. The steps below are the workflow I went through to create a seamless, collar-less USGS topographic map of Oahu. A more detailed step-by-step instruction is in the tutorial here, How To Convert GeoPDF to GeoTIFF using AcrcGIS. 

Step 1: Set the pdf layer's default visibility property

Open the geopdf and set the default property of each layer to on or off.  In the Layer Property window make sure that the Initial State section: Export is set to "Exports When Visible". Save the geopdf so the default properties of the layers are set. Double check by re-opening the geopdf again.

Step 2: Convert geoPDF to geoTIFF using PDF To TIFF tool

Access ArcToolbox in either ArcCatalog or ArcMap. Go to ArcToolbox >> Conversion Tools >> PDF To TIFF tool. In the PDF To TIFF dialog window, set your input parameters. Take note of these input parameter options:

  • PDF Map (optional): Map_Layers
  • Clip Output to Map (optional): check the box if you want collarless tiff
  • Write GeoTiff Tags (optional): check the box to ensure ArcGIS writes out the correct coordinates. Note however, the converted tiff image will say "Unknown Spatial Reference" You will not be able to change/edit the spatial reference of the tiff in ArcGIS, even though it is showing the image to be in the correct coordinates. More details on this and on how to work around the "Unknown Spatial Reference" issue are in the pdf document.

Step 3: Batch convert geoPDF using Model Builder

If you want to batch convert many geopdfs to geotiffs, you can use a file iterator in Model Builder or the PDF To TIFF tool's Batch Grid mode. I prefer to use the Model Builder method as the model is more portable and can be easily modified and shared. With The PDF To TIFF Batch Grid, you have to input each individual file and set its parameters, which if you have many geopdfs to convert gets to be tedious.

A Model Builder example

A Model Builder example

PDF To TIFF Batch Grid Mode

PDF To TIFF Batch Grid Mode

Step 4: Create raster catalog and/or mosaic of the geotiffs

After converting the geopdfs to geotiffs, you can create a raster catalog or mosaic to create a seamless set of quads. Make sure to specify the correct spatial reference when creating the catalog or mosaic. 

Raster catalog of 17 topo quads for Oahu. &nbsp;

Raster catalog of 17 topo quads for Oahu.