[Gdal-dev] Assign or define projection

Roger Bivand Roger.Bivand at nhh.no
Wed Feb 22 13:15:37 EST 2006


On Wed, 22 Feb 2006, Andy Bunn wrote:

> 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:

Hi Andy,

>From very soon, you'll be able to insert it in R. We're just finishing the 
final details before releasing rgdal_0.4-1, which has support for copying 
out the proj4string assigned to the SpatialGridDataFrame object. 

I guess there's a way in GDAL too.

Would you like to try a trial Windows binary?

Roger

> 
> 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
> 
> 
> 
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the Gdal-dev mailing list