<html><div style='background-color:'><DIV class=RTE>
<P>Hello Frank,</P>
<P> I forgot to mention that the gdalwarp app that comes with GDAL source projects everything nicely with just the following command: </P>
<P>C:\GDAL\Release\bin>gdalwarp -t_srs "+proj=latlong" C:\GDAL\TESTING\Test01\Image<BR>s\imagein.tif imageout.tif<BR>Creating output file that is 5887P x 4274L.<BR>:0...10...20...30...40...50...60...70...80...90...100 - done.</P>
<P>Obviously there is a reprojection distortion since the original image format is 5010 by 5010.</P>
<P> Ilya.</P></DIV>
<DIV></DIV>>From: Frank Warmerdam <fwarmerdam@gmail.com>
<DIV></DIV>>Reply-To: warmerdam@pobox.com
<DIV></DIV>>To: Ilya Serebrianik <predator2448@hotmail.com>
<DIV></DIV>>CC: gdal-dev@xserve.flids.com
<DIV></DIV>>Subject: Re: [Gdal-dev] UTM to Lat/Long projection
<DIV></DIV>>Date: Wed, 4 May 2005 15:10:44 -0400
<DIV></DIV>>
<DIV></DIV>>On 5/4/05, Ilya Serebrianik <predator2448@hotmail.com> wrote:
<DIV></DIV>> >
<DIV></DIV>> > Hello Frank,
<DIV></DIV>> >
<DIV></DIV>> > Thanks for clearing this up. I am not sure how to project from UTM
<DIV></DIV>> > NAD83 to Lat/Long WGS84. In your example application, namely gdalwrap, there
<DIV></DIV>> > is a option "+proj=latlong" which would be specified for the -t_srs in order
<DIV></DIV>> > to go from whatever the projection of the source into lat and long, I tried
<DIV></DIV>> > that and it works, but I do not know how to set this up inside my code, I
<DIV></DIV>> > tried using importFromProj4("+proj=longlat"), which should
<DIV></DIV>> > automatically set the lat/long option into the srs object I am about to
<DIV></DIV>> > assign to the destination image, like this:
<DIV></DIV>>
<DIV></DIV>>Ilya,
<DIV></DIV>>
<DIV></DIV>>And did the example you gave not work? In what way does it fail?
<DIV></DIV>>Do the pszSrcWKT and pszDstWKT seem OK?
<DIV></DIV>>
<DIV></DIV>> > OGRSpatialReference oSRS;
<DIV></DIV>> > //oSRS.SetUTM(17, TRUE);
<DIV></DIV>> > //oSRS.SetWellKnownGeogCS("WGS84");
<DIV></DIV>> > oSRS.importFromProj4("+proj=longlat");
<DIV></DIV>>
<DIV></DIV>>I would encourage you to be specific about the datum. So
<DIV></DIV>>you could do:
<DIV></DIV>>
<DIV></DIV>> oSRS.importFromProj4( "+proj=latlong +datum=WGS84" );
<DIV></DIV>>
<DIV></DIV>>Best regards,
<DIV></DIV>>--
<DIV></DIV>>---------------------------------------+--------------------------------------
<DIV></DIV>>I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com
<DIV></DIV>>light and sound - activate the windows | http://pobox.com/~warmerdam
<DIV></DIV>>and watch the world go round - Rush | Geospatial Programmer for Rent
<DIV></DIV></div></html>