wiki:USGS_PDF_Topo

Version 1 (modified by EliL, 13 years ago) ( diff )

draft to USGS PDF Topo conversion to geotif

Summary

  1. USGS offers new topo maps as a geospatial PDF http://www.gdal.org/frmt_pdf.html for download http://nationalmap.gov/ustopo/index.html. Direct download of specific file: http://ims.er.usgs.gov/gda_services/download?item_id=5365522
  2. Some users may prefer to have the Topo map as a geotif rather than PDF

Details

  1. GDAL must be built with Geospatial PDF support, see the above link for details. Confirm with:
    $ gdalinfo --formats
    Supported Formats:
    ...
      HF2 (rwv): HF2/HFZ heightfield raster
      PDF (rov): Geospatial PDF
      OZI (rov): OziExplorer Image File
    ...
    
  1. Use gdalinfo to get NEATLINE:
    $gdalinfo OR_Newport_North_20110824_TM_geo.pdf 
    Driver: PDF/Geospatial PDF
    Files: OR_Newport_North_20110824_TM_geo.pdf
    ...
    Metadata:
      NEATLINE=POLYGON ((421614.539994676539209 4956417.675689895637333,421413.787766160559841 4941008.479600958526134,409984.382813899661414 4941157.382794972509146,410185.135042413836345 4956566.578883905895054,421614.539994676539209 4956417.675689895637333))
    Corner Coordinates:
    ...
    
  1. Make an OGR datasource of the NEATLINE to use as a cutline in gdalwarp. This can be two files, a .vrt and .csv

wkt_cutline_file.vrt:

<OGRVRTDataSource>
             <OGRVRTLayer name="NEATLINE">
                <SrcDataSource >NEATLINE.csv</SrcDataSource>
                <GeometryType>wkbPolygon</GeometryType>
                <FID>Record_Id</FID>
                <GeometryField encoding="WKT" field="wkb_Polygon"/>
                <LayerSRS>EPSG:26910</LayerSRS>
            </OGRVRTLayer>
</OGRVRTDataSource> 

NEATLINE.csv:

"Record_Id","wkb_Polygon"
"1","POLYGON ((421614.539994676539209 4956417.675689895637333,421413.787766160559841 4941008.479600958526134,409984.382813899661414 4941157.382794972509146,410185.135042413836345 4956566.578883905895054,421614.539994676539209 4956417.675689895637333))"
  1. Use gdal_translate or gdalwarp to convert to geotif and if using gdalwarp, -cutline to the NEATLINE.
    gdalwarp -cutline wkt_cutline_file.vrt -cl NEATLINE -crop_to_cutline OR_Newport_North_20110824_TM_geo.pdf OR_Newport_North_20110824_TM_geo.tif
    

Notes

  • There is probably a more elegant way to grab the NEATLINE for use.
  • This could be combined with gdalinfo to determine which file to download.
    gdalinfo "WMS: 
    
Note: See TracWiki for help on using the wiki.