[Gdal-dev] Problem with Gdalwarp
[ESW] Jan B.
digar at esw.rwth-aachen.de
Tue May 30 01:37:34 EDT 2006
Hi out there!
I not a really good programmer or really good in English, so I hope I did
everything right and it is not wrong to write my problem here. Additionally
I hope I have sucessfully added my email adress to this mailing list.
Now the problem. I try to write a programm which puts some USGS SRTM bil
files together. I tried carefully to review all help in the net, exspecially
on the gdal page and used code from the turtorials, where possible. So the
core of my code is this:
GDALDataset *poDataset;
double adfGeoTransform[6];
const char *pszFormat = "GTiff";
// To Register the necessary Drivers for GeoTiff and BIL
GDALAllRegister();
/*---------------------------------------
* Open Dataset to copy information
*/
const char *pszShadeFilename="target.tif";
poDataset = (GDALDataset *) GDALOpen( "input.bil",GA_ReadOnly );
GDALRasterBand *poBand;
/* Data is while using SRTM Data always in the first band */
poBand = poDataset->GetRasterBand( 1 );
poDataset->GetGeoTransform( adfGeoTransform );
/* -----------------------------------------
* Create the output dataset and copy over relevant metadata
*/
GDALDriver *poDriver;
poDriver = GetGDALDriverManager()->GetDriverByName(pszFormat);
GDALDataset *poShadeDS;
GDALRasterBand *poShadeBand;
char **papszOptions = NULL;
poShadeDS =
poDriver->Create(pszShadeFilename,p_xArraySize,p_yArraySize,1,GDT_Float32,
papszOptions );
poDataset->GetGeoTransform( adfGeoTransform );
poShadeDS->SetProjection( poDataset->GetProjectionRef() );
poShadeDS->SetGeoTransform( adfGeoTransform );
....
Now, when I try to use the gdalwarp.exe with
gdalwarp -t_srs \"+proj=utm +zone=11 +datum=WGS84\" source.tif target.tif
I get the error
ERROR 1: Too many points (441 out of 441) failed to transform,
unable to compute output bounds.
I am searching for the problem now for 5 days and cannot find it.
Location of sample file to convert file:
http://home.arcor.de/beitronik/gdal/target.tif
(I know the file is very small, a bigger one can be found at:
http://home.arcor.de/beitronik/gdal/target2.tif
)
Perhaps you can help me, I would be very thankfull.
Jan Beiten
More information about the Gdal-dev
mailing list