[Gdal-dev] Set Projection

salah jubeh s_jubeh at yahoo.com
Mon Feb 20 16:42:21 EST 2006


Hello.
   
  I am creating an image out of another image, i read the meta data information  from one image and assign it to he other image.
  this is the code i use to do it.
   
  DALSetGeoTransform( hDstDS, adfGeoTransform );
  GDALSetProjection( hDstDS, pszPrettyWkt);
  
  hBand = GDALGetRasterBand( hDstDS, 1 );
  GDALRasterIO( hBand, GF_Write, 0, 0, nXSize, nYSize, 
  pafScanline, nXSize, nYSize, GDT_Float32, 0, 0 ); 
  GDALClose( hDstDS );
   
  When i comment the  GDALSetProjection( hDstDS, pszWkt); i find that the image geotransformation matrix was set correctly . Also when i use GDALSetProjection( hDstDS, pszWkt); the geo transformation matrix not inserted neither the projection.
   
  I checked the PszWkt it give me this 
   
  PROJCS["IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $
Projection Name = Transverse Mercator
Uni",GEOGCS["IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.10.1.6 $ $Date: 2003/10/17 16:36:51EDT $
Unable to match Ellipsoid (Datum) to a Ge",DATUM["unknown",SPHEROID["unnamed",63
78137,298.2572220960423]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433
]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER
["central_meridian",24],PARAMETER["scale_factor",0.9996],PARAMETER["false_eastin
g",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]
]]
   
  The original image has this prjection  
   
  Projection: Transverse Mercartor
  Spheroid:GRS 180
  Datum:EGSA 97
   
  I notice here the datum and the spheroid are not recognized is this why i can not update the projection.
   

		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060220/10a0ca1f/attachment.html


More information about the Gdal-dev mailing list