[gdal-dev] gdal_translate and -projwin

Wendell Turner wendell at enflight.com
Wed May 14 12:04:15 EDT 2008


Are the projwin arguments to gdal_translate signed lat/lng?
I'm trying to crop a GeoTIFF image, but something is amiss.

The gdalinfo is shown below, so it seems that this should
work:
  gdal_translate ny71n.tif -projwin -77.0 44.0 -69.0 42.0 crop.tif
however, this results in
  Input file size is 12069, 4319
  Computed -srcwin 99674 62813 0 0 from projected window.
  Computed -srcwin falls outside raster size of 12069x4319.

I also tried it with the last two parameters as width and
height (I thought I read that somewhere):
  gdal_translate ny71n.tif -projwin -77.0 44.0 7.0 -2.0 cropx.tif
but with approx. the same results.

What should the parameters be to crop the image using
lat/lng?

Thanks,

Wendell

--------------------------------------------------------

Driver: GTiff/GeoTIFF
Files: ny71n.tif
Size is 12069, 4319
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235630016,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (-8695881.965399086475372,5480014.707196786999702)
Pixel Size = (87.242429161146731,-87.242429161146731)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-8695881.965, 5480014.707) ( 78d 6'59.17"W, 44d17'10.81"N)
Lower Left  (-8695881.965, 5103214.656) ( 78d 6'59.17"W, 41d48'15.36"N)
Upper Right (-7642953.088, 5480014.707) ( 68d39'28.14"W, 44d17'10.81"N)
Lower Right (-7642953.088, 5103214.656) ( 68d39'28.14"W, 41d48'15.36"N)
Center      (-8169417.527, 5291614.681) ( 73d23'13.65"W, 43d 3'28.61"N)
Band 1 Block=12069x1 Type=Byte, ColorInterp=Palette
  Color Table (RGB with 256 entries)
    0: 249,238,246,255
    1: 218,229,139,255
    2: 222,236,184,255
    ...



More information about the gdal-dev mailing list