[gdal-dev] gdalwarp - source srs definition

Volker Wichmann Volker.Wichmann at uibk.ac.at
Fri Jun 27 03:58:31 EDT 2008


Hi,

I have a bunch of esri ascii rasters, from which I generate subsets via 
gdalwarp. All the asciis have the same projection, e.g.:

cat dtm_utm09091.prj
PROJECTION UTM
UNITS meters
SPHEROID WGS84
DATUM WGS84
ZONE 32
PARAMETERS

gdalinfo dtm_utm09091.ascii
Driver: AAIGrid/Arc/Info ASCII Grid
Size is 1281, 1121
Coordinate System is:
PROJCS["UTM Zone 32, Northern Hemisphere",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AXIS["Lat",NORTH],
        AXIS["Long",EAST],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",9],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["meters",1]]
Origin = (659398.750000000000000,5170401.250000000000000)
Pixel Size = (2.500000000000000,-2.500000000000000)
Corner Coordinates:
Upper Left  (  659398.750, 5170401.250) ( 11d 5'1.71"E, 46d40'5.48"N)
Lower Left  (  659398.750, 5167598.750) ( 11d 4'58.22"E, 46d38'34.75"N)
Upper Right (  662601.250, 5170401.250) ( 11d 7'32.32"E, 46d40'2.71"N)
Lower Right (  662601.250, 5167598.750) ( 11d 7'28.76"E, 46d38'31.98"N)
Center      (  661000.000, 5169000.000) ( 11d 6'15.25"E, 46d39'18.74"N)
Band 1 Block=1281x1 Type=Float32, ColorInterp=Undefined
  NoData Value=-9999

I create subsets with gdalwarp, e.g.
gdalwarp -te 671998.75 5131893.75 682141.25 5141126.25 -of GTiff -ot 
Float32 -dstnodata -9999  dtm_utm03113.ascii dtm_utm03111.ascii dtm_sub.tif

I do not define -s_srs, as I suspect it is read from the input files 
when I look in the gdalwarp code. The strange thing is now, that 
gdalwarp sometimes reports
ERROR 1: Failed to import coordinate system `'.
on some of the rasters and thus does not write the projection info to 
the output file. When I run gdalinfo on each input file, everything is 
reported correctly.
Has anybody encountered this too and could give me some hints?

Thanks,
Volker

PS:
gdalinfo --version
GDAL 1.4.3.0, released 2007/10/28




More information about the gdal-dev mailing list