[gdal-dev] HOW-TO convert USGS topo to GTiff

Smith, Michael Michael.Smith at maine.gov
Thu Mar 27 07:21:18 PDT 2014


I have had several people send me follow-up emails about converting the USGS eTopos (you can download these from store.usgs.gov), so I thought it might make sense to just post this to the list as a HOW-TO.  Apologies for cross-post.

The challenge is to take the GeoPDF that you download from USGS and make it into a series of TIFFs you can mosaic together.  This requires at least GDAL 1.8 and for full functionality you want 1.10.

First, the simplest syntax would be

gdal_translate topo.pdf topo.tif

That would give you a GeoTiff with all the layers turned on, rendered at 150 dpi.  Easy enough.

However, depending on what you want, you may want to alter that.  For example the GeoPDF renders differently as you zoom in; it has scale-dependent rendering.  So you may want to change the dpi to a higher number.  I did all mine at 300 dpi which seemed to fit a 24k rendering in ArcMap and looks nice on the screen.

gdal_translate --config GDAL_PDF_DPI 300 topo.pdf topo.tif

That still has all the layers turned on though.  You may want some of them off.  For example, you may want to turn off the NAIP data and the UTM grid (like I did).  If so you can specify certain LAYERS to turn off, first you have to figure out what they are with this (this requires GDAL 1.10):

gdal_info -mdd LAYERS topo.pdf

will return the metadata and a list of layers something like this:
<snip>
Metadata (LAYERS):
  LAYER_00_NAME=Map_Collar
  LAYER_01_NAME=Map_Collar.Map_Elements
  LAYER_02_NAME=Map_Frame
  LAYER_03_NAME=Map_Frame.Projection_and_Grids
  LAYER_04_NAME=Map_Frame.Projection_and_Grids.Projection_Coordinate_Values
  LAYER_05_NAME=Map_Frame.Projection_and_Grids.Geographic_and_Grid_Ticks
  LAYER_06_NAME=Map_Frame.Projection_and_Grids.Projection_Line_Mask
  LAYER_07_NAME=Map_Frame.Projection_and_Grids.Grid_Lines
<snip>
  LAYER_28_NAME=Map_Frame.Land_Cover.Woodland
  LAYER_29_NAME=Images
  LAYER_30_NAME=Images.Orthoimage
<snip>

So I'm looking to get rid of layer 7 and layer 30.  The syntax for that uses the layer name like this:

gdal_translate --config GDAL_PDF_DPI 300 --config GDAL_PDF_LAYERS_OFF Map_Frame.Projection_and_Grids.Grid_Lines,Images.Orthoimage topo.pdf topo.tif

This only works for the new 2011/12/13 maps.  The historic maps are scanned images, so they don't have any real layers.  They are just one raster image in a PDF.  So you would just do
gdal_translate --config GDAL_PDF_DPI 300 topo.pdf topo.tif.

What you get in both cases is an output GeoTIFF of the topo map.  The map will have all the collar info, so you will then have to crop the images, remove the collars, and mosaic the slivers to get a seamless mosaic, but that is just done the same way as any other imagery collection.  That process is to simply:
                Crop the image to its minimum size with gdalwarp
                Burn some null value to the remaining collar slivers with gdal_rasterize -i -burn <etc.>
                Mosaic the neighboring tile data into the sliver with gdalwarp

One other cool thing about the GeoPDF with its scale-dependent rendering is that you could create topos at different dpis (scales) and thus make your overviews look like what a 100K or 250K topo would look like (well with the new ones anyway, not the historic ones).

Don't forget to RTF(riendly!)M http://www.gdal.org/frmt_pdf.html


===============================
Michael Smith MS GISP
State GIS Manager, Maine Office of GIS
State of Maine, Office of Information Technology
michael.smith _at_ maine.gov 207-215-5530

Board Member, Maine GeoLibrary
Education Chair, Maine GIS Users Group
State Rep, National States Geographic Information Council
[cid:image001.jpg at 01CF49A3.32BF2BC0]

State House Station 145
51 Commerce Drive
Augusta, ME 04333-0145
69o 47' 58.9"W  44o 21' 54.8"N
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140327/6f27827a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 9032 bytes
Desc: image001.jpg
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140327/6f27827a/attachment-0001.jpg>


More information about the gdal-dev mailing list