[gdal-dev] basic questions about tiles

Noura Shamsi noura.salem.shamsi at gmail.com
Wed Mar 21 02:57:32 EDT 2012


am pretty new working with gdal and GIS, so please forgive my inexperience;
i have read alot about how to request tiles but am still a bit confused;

am trying to get the tiles according to the elevation data that i have
(dt2);
lets say i will request this tile from map street     poDataset =
(GDALDataset *) GDALOpen( "http://tile.openstreetmap.org/15/23687/15190.png",
GA_ReadOnly );

now my first question is:

since i have the elevation data i will be able to request different tiles
from the same server by changing the zoom level x and y ?

my second question is:

how can i convert the buffer that i got here to the actual image or tile?
        poDataset = (GDALDataset *) GDALOpen( "
http://tile.openstreetmap.org/15/23687/15190.png", GA_ReadOnly );
        GDALRasterBand  *poBand;
        poBand = poDataset->GetRasterBand( 1 );

        int xsize = poDataset->GetRasterXSize();
        int ysize = poDataset->GetRasterYSize();
        float*buffer = new float[xsize * ysize];
        poBand->RasterIO(GF_Read, 0, 0, xsize, ysize, buffer, xsize, ysize,
GDT_Float32, 0, 0);
        for (int j = 0; j < ysize; ++j) {
            for (int k = 0; k < xsize; ++k) {
                qDebug() << buffer[j * xsize + k] << " ";
            }
            qDebug() << endl;
        }
        }
        poDataset->FlushCache();


i will appreciate any directions comments or examples
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120321/00484d97/attachment.html


More information about the gdal-dev mailing list