Re: [gdal-dev] Raster visualization
Ivan Lucena
ivan.lucena at princeton-ma.us
Thu May 10 12:12:48 EDT 2012
Petr,
The GDAL API dos not contain visualization functions. So how to do it will dependents on the programming environment that you are working on, assuming that you are developing some kind of application. The pData pointer points to a memory array of pixels in the data type and the amount of data you requested in you call. You could just pass it to your GUI component or you could do some pixel accessing of your own if you want.
Take a look at this example in Java [http://trac.osgeo.org/gdal/browser/trunk/gdal/swig/java/apps/GDALtest.java]
If all you want to do is to display a small region of a raster, you could simple use gdal_translate -of {JPEG,BMP,PNG} -srcwin and open the little picture file on the desktop visualization tool that comes with the O.S.
C:/> gdal_translate -of bmp bigfile.tif out.bmp -srcwin 0 0 1024 1024
C:/> out.bmp
Regards,
Ivan
> -------Original Message-------
> From: Petr Kitashov <hilmekrhu at gmail.com>
> To: gdal-dev at lists.osgeo.org
> Subject: [gdal-dev] Raster visualization
> Sent: May 10 '12 08:48
>
> Hi,
>
> I need just to display some region(any) from raster file. Seems like I
> understand everything until rasterIO.
> RasterIO fills(in my case) void* pData with raster info - that's
> great, but how to display it?
>
> Which data is stored there when I use GDALDataset::rasterIO, and which in
> case of GDALRasterBand::RasterIO?
>
> I.e. how to determine pixel values from pData?
>
> I'm sorry if this question is stupid, but i spent a lot of time in
> google and didn't find any solution.
>
>
> --
> Best Regards,
> Petr Kitashov
> --------------------
> _______________________________________________
> gdal-dev mailing list
> [LINK: compose.php?to=gdal-dev at lists.osgeo.org] gdal-dev at lists.osgeo.org
> [LINK: http://lists.osgeo.org/mailman/listinfo/gdal-dev]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list