[gdal-dev] GDALGetProjectionRef(...) problem on filetype JPEG and BMP

alex sharukan at mail.ru
Thu Sep 17 07:44:41 EDT 2009


  Good day.
  I encountered the following problem using GDAL. GDALGetProjectionRef(...) works with file formats TIF, but JPG and BMP returns an empty string.

  Used as:
  There have been downloaded sources from http://download.osgeo.org/gdal/gdal162.zip
Sources was built using Visual Studio 2005, the utility nmake, using the command line interface.
  Then was opened raster map file with format MapInfo by my program. MapInfo file was created by using the export map function of the MapInfo program. 

  I used the C API library GDAL. In the body of the program:

GDALDatasetH pDataset = GDALOpen("map_filename", GA_ReadOnly);

  and

GDALGetGeoTransform(...) and GDALRasterIO(...)

  Then I opened the map file and exported part of it to coordinatesof I needed.
  It worked with the map file format map_filename.tif + map_filename.tab, map_filename.jpg + map_filename.tab,map_filename.bmp + map_filename.tab.
	
  Then I could to get access to the map coordinates in the format .TIF using the function:

GDALGetProjectionRef(pDataset) 

  which returned the projection maps of the form <wkt format projection string>, as was intended.

  But when opening files type .JPG and .BMP 

GDALGetProjectionRef (pDataset)

  returns an empty string "".
  I think that the library is somehow obtains a coordinate system maps, because 
GDALGetGeoTransform (...) work.

  Please specify how i can get a system of map coordinates for these files are JPG and BMP and import it into an object of class OGRSpatialReference. 
	
  I apologize for my poor language skills.
  Thank you.




More information about the gdal-dev mailing list