<div dir="ltr"><div><div><div>hi ,<br>poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly );<br><br>    if( poDataset != NULL )<br>    {<br>        numBands = poDataset->GetRasterCount();<br>        width = poDataset->GetRasterXSize();<br>        height = poDataset->GetRasterYSize();<br>        GDALRasterBand  *poBand;<br>        poBands = new GDALRasterBand*[numBands];<br><br><br>        poBand = poDataset->GetRasterBand(1);<br><br>        dataType = (GDALDataType)poBand->GetRasterDataType();<br>        bytesPerPixel =GDALGetDataTypeSize((GDALDataType)dataType)/8;<br>    }<br>    const char *ch =   poDataset->GetProjectionRef();<br>    double *tiepoints = new double[6];<br>    poDataset->GetGeoTransform(tiepoints);<br>    for(int i=0;i<6;i++)<br>    {<br>        qDebug()<<"tie points"<< tiepoints[0];<br>    }<br>    uchar *data;<br><br>    data = (uchar *) /*CPLMalloc*/new char[(sizeof(uchar)*width*height*bytesPerPixel*numBands)];<br>    int bandIndices[numBands];<br>    double scale = 5.0;<br><br>    for(int j=0 ;j<numBands ;j++)<br>    {<br>        bandIndices[j] = j;<br>    }<br>    for(int i = 0; i < numBands; i++)<br>    {<br>        poBands[i] = poDataset->GetRasterBand(bandIndices[i]+1);<br>        poBands[i]->SetScale(10);<br><br>        poBands[i]->RasterIO(GF_Read, 0, 0, width, height,data+(bytesPerPixel*i), width, height, (GDALDataType)dataType, numBands*bytesPerPixel, 0);<br><br>    }<br><br><br></div>actually i am trying to read the projection string and the tie points .the above is the code im using.<br><br></div>thanks,<br></div>hema<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 8, 2015 at 5:21 PM, Jukka Rahkonen <span dir="ltr"><<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Hema Yeedunuri <hema.yeedunuri <at> <a href="http://amigooptima.in" rel="noreferrer" target="_blank">amigooptima.in</a>> writes:<br>
<br>
> hi all,<br>
> i have a geotiff file .i have wrapper classes for gdal for reading and<br>
writing.gdal version is 1.11 and proj is 4.2 .whe i try to load a file it is<br>
giving following error.i am using ubuntu 12.04.<br>
> ERROR 1: Only OGC WKT Projections supported for writing to GeoTIFF.<br>
<br>
</span>I fear that with that information nobody can solve your issue. The error<br>
suggests that you are trying to write into GeoTIFF something that is not OGC<br>
WKT Projection. You must tell us what you try to write into GeoTIFF, even<br>
better if you attach the failing code as well.<br>
<br>
You say that you try to load a file and the error says that you try to write<br>
something invalid into a file so perhaps your code does not do what you<br>
believe it does.<br>
<br>
For self-help I believe this is useful <a href="http://www.gdal.org/osr_tutorial.html" rel="noreferrer" target="_blank">http://www.gdal.org/osr_tutorial.html</a><br>
and probably this also<br>
<a href="http://stackoverflow.com/questions/13158795/create-a-geotiff-from-an-existing-bitmap-in-c-sharp-with-gdal" rel="noreferrer" target="_blank">http://stackoverflow.com/questions/13158795/create-a-geotiff-from-an-existing-bitmap-in-c-sharp-with-gdal</a>.<br>
<br>
-Jukka Rahkonen-<br>
<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" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br></div>