[gdal-dev] GetProjectionRef returns ' '

Frank Warmerdam warmerdam at pobox.com
Fri Jul 2 09:21:46 EDT 2010


On Fri, Jul 2, 2010 at 3:11 PM, Francois Maass <fieliesm at gmail.com> wrote:
> Hello everyone!
>
>
>
> I have as input, two satellite images, one in .pix format and the other in
> .TIF format.
> I am trying to do projections between these two images, and have a function
> which contains the following:
>
>
>
> if( gdalDataset->GetProjectionRef()  != NULL )
>
>         printf( "Projection is `%s'\n", gdalDataset->GetProjectionRef() );
>
>
>
>
>
> When I call this function with the .pix image as parameter, I get the entire
> projection definition string, but when I pass the .TIF image as parameter, I
> get “Projection is ‘ ‘”.
>

Francois,

I believe that GetProjectionRef() is supposed to return an empty string
rather than NULL when there is no coordinate system.  It would appear
the GeoTIFF lacks any coordinate system definition or it was completely
not recognizable to the driver.

If you are convinced the file should have a coordinate system already,
you might try examining it with the listgeo utility (from the libgeotiff
distribution) and it will show the internal geotiff details.

Best regards,
-- 
---------------------------------------+--------------------------------------
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