[gdal-dev] General Questions about gdal usage with Grib1 Data Set

Frank Warmerdam warmerdam at pobox.com
Mon Jul 20 17:14:27 EDT 2009

Cassanova, Bill wrote:
> Thank you for your help.
> Couple more questions:
> (1)
> After the call to  GDALGenImgProjTransform( ..., ..., ...,  double *x,
> double *y, ..., ... );
> I am assuming that the x and y arguments contain the new lat-lon values
> from the new projection and does not contain the data from the grid.  In
> other words I would need to maintain the data in a matrix of my own and
> then given the results of X and Y determine an appropriate offset into
> the rows and columns of that matrix.  That being said, I would assume
> that when data is re-projected that the raster now has a new set of
> corner points but the same number of rows and columns of data as was
> original.  Am I correct? Do I have anyway of determining the new corner
> points?  Has the original number of rows and columns changed?


The function does not warp the raster.  It is just a transformer to make
it easy to get from some georeferenced image space back to a particular
pixel/line location.  So you would feed in long/lat coordinates in
x/y and after the trasnform function returns these variables will
hold pixel/line locations.  You could then use GDAL's RasterIO() to
read the actual pixel values at that location - or you could have read
the whole image into RAM and pull it from an array in memory.

> (2)  My assumption is the C API GDALCreateGenImgProjTransformer and
> GDALGenImgProjTransform function calls do not have C++ equivalents
> buried in one of the classes somewhere.  I looked briefly at gdalwarper
> and saw a few methods that looked similar but nothing that matches the
> functionality of these calls.

That is correct, just use the C entry points.

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list