[gdal-dev] gdalwarp cutline layer for USGS GeoPDF maps

Kris Andersen kris.andersen at gmail.com
Fri Jan 18 14:43:39 PST 2013


I'm having trouble using the -crop_to_cutline option in gdalwarp to remove whitespace around USGS topo maps. These maps are in the GeoPDF format, and contain a NEATLINE metadata value that is suppose to provide the information to crop the image. 
I thought I could do this using the -cl flag,

gdalwarp -crop_to_cutline -cl NEATLINE VA_Strasburg_20110524_TM_geo.pdf test.tiff

but that didn't work. I still see lots of whitespace, and the image looks oddly skewed.

Any idea what's going on here? I'm using gdal 1.10dev, compiled from the svn repository (version 25519).

Below is the metadata available in the GeoPDF. The file I'm working with can be downloaded from the following link, but be warned, it's a 24 MB download.

    http://tinyurl.com/avk4dra  (warning! 24 MB download)

More info about the data format is at
    
    http://store.usgs.gov/locator/about_digital_maps.html

$ gdalinfo VA_Strasburg_20110524_TM_geo.pdf -mdd LAYERS
Driver: PDF/Geospatial PDF
Files: VA_Strasburg_20110524_TM_geo.pdf
Size is 3413, 4350
Coordinate System is:
PROJCS["UTM Zone 17, Northern Hemisphere",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-81],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
GeoTransform =
  725762.3169985006, 4.062235054313516, 0.119677163262725
  4321534.199114115, 0.119677163262725, -4.062235054313516
Metadata:
  AUTHOR=USGS National Geospatial Technical Operations Center
  CREATION_DATE=D:20110524074140Z
  CREATOR=ESRI ArcSOC 9.3.1.3000
  KEYWORDS=Topographic, Transportation, Hydrography, Orthoimage, U.S. National Grid, imageryBaseMapsEarthCover, Imagery and Base Maps, Geographic Names Information System
  NEATLINE=POLYGON ((739349.486192459356971 4305760.633085563778877,726989.596524115651846 4305396.499421719461679,726535.950552191701718 4320794.730121357366443,738895.840220535406843 4321158.863785205408931,739349.486192459356971 4305760.633085563778877))
  SUBJECT=This image map depicts geographic features on the surface of the earth.  It was created to provide a representation of accessible geospatial data which is readily available to enhance the capability of Federal, State, and local emergency responders for homeland security efforts.  This image map is generated from selected National Map data holdings and other cartographic data.
  TITLE=USGS 7.5-minute image map for Strasburg, Virginia
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
  LAYER_08_NAME=Map_Frame.Geographic_Names
  LAYER_09_NAME=Map_Frame.Geographic_Names.Geographic_Names
  LAYER_10_NAME=Map_Frame.Boundaries
  LAYER_11_NAME=Map_Frame.Boundaries.Boundary_Names
  LAYER_12_NAME=Map_Frame.Boundaries.Boundaries
  LAYER_13_NAME=Map_Frame.Transportation
  LAYER_14_NAME=Map_Frame.Transportation.Road_Names_and_Shields
  LAYER_15_NAME=Map_Frame.Transportation.Roads
  LAYER_16_NAME=Map_Frame.Transportation.Airport_Names
  LAYER_17_NAME=Map_Frame.Transportation.Airports
  LAYER_18_NAME=Map_Frame.Hydrography
  LAYER_19_NAME=Map_Frame.Hydrography.Hydrographic_Names
  LAYER_20_NAME=Map_Frame.Hydrography.Hydrographic_Features
  LAYER_21_NAME=Map_Frame.Contours
  LAYER_22_NAME=Map_Frame.Contours.Contour_Names
  LAYER_23_NAME=Map_Frame.Contours.Contour_Features
  LAYER_24_NAME=Images
  LAYER_25_NAME=Images.Orthoimage
Corner Coordinates:
Upper Left  (  725762.317, 4321534.199) 
Lower Left  (  726282.913, 4303863.477) 
Upper Right (  739626.725, 4321942.657) 
Lower Right (  740147.321, 4304271.935) 
Center      (  732954.819, 4312903.067) 
Band 1 Block=3413x1 Type=Byte, ColorInterp=Red
Band 2 Block=3413x1 Type=Byte, ColorInterp=Green
Band 3 Block=3413x1 Type=Byte, ColorInterp=Blue

Any help you can provide is appreciated!

  Kris



More information about the gdal-dev mailing list