[Gdal-dev] Assign or define projection
Andy Bunn
abunn at whrc.org
Wed Feb 22 11:58:38 EST 2006
Gdal-helpers:
If I have an image with no projection, what is the simplest way to assign a
projection to it? Can I do it without making a new file? An example is below
but the summary is, given image foo.tif that has no projection info is the
best way to assign/define the projection using:
gdalwarp -s_srs "WGS84" -t_srs "WGS84" foo.tif bar.tif
Thanks, Andy
Y:\GMAO\apr_2004_tif_mean>gdalinfo 20040401.tif
Driver: GTiff/GeoTIFF
Size is 288, 181
Coordinate System is `'
Origin = (-180.000000,90.000000)
Pixel Size = (1.25000000,-0.99447514)
Corner Coordinates:
Upper Left (-180.0000000, 90.0000000)
Lower Left (-180.0000000, -90.0000000)
Upper Right ( 180.0000000, 90.0000000)
Lower Right ( 180.0000000, -90.0000000)
Center ( 0.0000000, 0.0000000)
Band 1 Block=288x7 Type=Float32, ColorInterp=Gray
Y:\GMAO\apr_2004_tif_mean>gdalwarp -s_srs "WGS84" -t_srs "WGS84"
20040401.tif 20040401_proj.tif
Creating output file that is 304P x 152L.
:0...10...20...30...40...50...60...70...80...90...100 - done.
Open GDAL Datasets:
1 N DriverIsNULL 512x512x0
Y:\GMAO\apr_2004_tif_mean>gdalinfo 20040401_proj.tif
Driver: GTiff/GeoTIFF
Size is 304, 152
Coordinate System is:
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"]]
Origin = (-180.000000,90.000000)
Pixel Size = (1.18326343,-1.18326343)
Metadata:
AREA_OR_POINT=Area
Corner Coordinates:
Upper Left (-180.0000000, 90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
Lower Left (-180.0000000, -89.8560420) (180d 0'0.00"W, 89d51'21.75"S)
Upper Right ( 179.7120840, 90.0000000) (179d42'43.50"E, 90d 0'0.00"N)
Lower Right ( 179.7120840, -89.8560420) (179d42'43.50"E, 89d51'21.75"S)
Center ( -0.1439580, 0.0719790) ( 0d 8'38.25"W, 0d 4'19.12"N)
Band 1 Block=304x6 Type=Float32, ColorInterp=Gray
More information about the Gdal-dev
mailing list