Hi Alex,<br>How your TIF and BMP files are generated?<br>Are you writing them by yourself from an input image?<br>In
that case, make sure to create a samenamefile.jpg.aux.xml file
containing a <PAMDataset> tag with the <SRS> definition on
it.<br>
Try using gdal_translate -of JPEG mytiff.tif myjpeg.jpg to see how that aux.xml should be formed.<br><br>Regards,<br>Daniele<br><br><br><div class="gmail_quote">2009/9/17 alex <span dir="ltr"><<a href="mailto:sharukan@mail.ru">sharukan@mail.ru</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Good day.<br>
I encountered the following problem using GDAL. GDALGetProjectionRef(...) works with file formats TIF, but JPG and BMP returns an empty string.<br>
<br>
Used as:<br>
There have been downloaded sources from <a href="http://download.osgeo.org/gdal/gdal162.zip" target="_blank">http://download.osgeo.org/gdal/gdal162.zip</a><br>
Sources was built using Visual Studio 2005, the utility nmake, using the command line interface.<br>
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.<br>
<br>
I used the C API library GDAL. In the body of the program:<br>
<br>
GDALDatasetH pDataset = GDALOpen("map_filename", GA_ReadOnly);<br>
<br>
and<br>
<br>
GDALGetGeoTransform(...) and GDALRasterIO(...)<br>
<br>
Then I opened the map file and exported part of it to coordinatesof I needed.<br>
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.<br>
<br>
Then I could to get access to the map coordinates in the format .TIF using the function:<br>
<br>
GDALGetProjectionRef(pDataset)<br>
<br>
which returned the projection maps of the form <wkt format projection string>, as was intended.<br>
<br>
But when opening files type .JPG and .BMP<br>
<br>
GDALGetProjectionRef (pDataset)<br>
<br>
returns an empty string "".<br>
I think that the library is somehow obtains a coordinate system maps, because<br>
GDALGetGeoTransform (...) work.<br>
<br>
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.<br>
<br>
I apologize for my poor language skills.<br>
Thank you.<br>
<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-------------------------------------------------------<br>Eng. Daniele Romagnoli <br>Software Engineer<br><br>GeoSolutions S.A.S.<br>Via Carignoni 51<br>55041 Camaiore (LU)<br>
Italy<br><br>phone: +39 0584983027<br>fax: +39 0584983027<br>mob: +39 328 0559267<br><br><br><a href="http://www.geo-solutions.it">http://www.geo-solutions.it</a><br><br>-------------------------------------------------------<br>
<br>