Thanks for the suggestion but I'm developing a Win32 app.<br>I will take in consideration your previous answer because the app can read images from other sources.<br><br>Regards,<br>Stefano<br><br>-- <br>Dr.Eng. Stefano Moratto<br>
<a href="mailto:stefano.moratto@gmail.com">stefano.moratto@gmail.com</a><br><a href="mailto:stefano.moratto@csiat.it">stefano.moratto@csiat.it</a><br><a href="http://www.csiat.it">http://www.csiat.it</a> - Traffic Optimization Software<br>
<br><div class="gmail_quote">On Tue, Feb 8, 2011 at 11:38 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Le mardi 08 février 2011 23:33:39, Stefano Moratto a écrit :<br>
<div class="im">> The openstreet data is a virtual image composed by several tiles at a given<br>
> zoom level, each tiles is a 256x256 png, so I think if a thead read a<br>
> 256x256 block i will access only a given png.<br>
<br>
</div>Yes of course reading different images by different threads will work. If you<br>
use GDAL on Unix, be sure that it is built with the --with-threads option,<br>
which had to be explicitely passed before GDAL 1.8.0 and is now the default.<br>
<br>
My previous answer only applies if you divide the reading of a single PNG<br>
image into several threads.<br>
<div><div></div><div class="h5"><br>
><br>
> On Tue, Feb 8, 2011 at 11:14 PM, Even Rouault<br>
><br>
> <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>>wrote:<br>
> > Le mardi 08 février 2011 23:07:36, Stefano Moratto a écrit :<br>
> > > Thanks for the suggestion,<br>
> > ><br>
> > > I have to read png from openstreetmap. I'm trying to render an A4 paper<br>
> > > size sheet so I have a lot of data to move.<br>
> > > It may be better to divide the area to be read in blocks and to give to<br>
> > > each thread a block. Foreach block a thread should read all the bands.<br>
> > > Probabilly I should allign the block to the tile's boundary<br>
> ><br>
> > Unfortunately the PNG format is such that it is not possible to seek to<br>
> > an arbitrary line without decoding the data of all previous scanlines,<br>
> > so this approach won't work. The same would be true for JPEG or GIF. If<br>
> > you can fetch<br>
> > the data as TIFF, you could however try that approach.<br>
> ><br>
> > > Stefano<br>
> > ><br>
> > > > Le mardi 08 février 2011 22:41:50, Stefano Moratto a écrit :<br>
> > > > > Hello,<br>
> > > > ><br>
> > > > > given an opened GDAL dataset, is it possibile to perform<br>
> > > > ><br>
> > > > > gdalrasterio calls for each band in a dedicated thread per band in<br>
> > > > > a thead-safe way?<br>
> > > > > E.g. I have a raster image with 3 band (r,g,b). Since I have 4 core<br>
> > > > > I<br>
> > > ><br>
> > > > would<br>
> > > ><br>
> > > > > like to I run a thread for a band r, one for band g and one for<br>
> > > > > band<br>
> ><br>
> > g.<br>
> ><br>
> > > > This has been discussed recently. See<br>
> > > > <a href="http://lists.osgeo.org/pipermail/gdal-" target="_blank">http://lists.osgeo.org/pipermail/gdal-</a><br>
> > > > dev/2011-January/027567.html and the following messages.<br>
> > > ><br>
> > > > (I'd note that if you process a pixel interleaved image, there are<br>
> > > > optimizations in the GTiff driver to make the fetching of other bands<br>
> > > > almost<br>
> > > > 'free' if you read block by block, so there's probably little to<br>
> > > > gain, but the<br>
> > > > results of your experiments are welcome)<br>
> > > ><br>
> > > > > Regards,<br>
> > > > > Stefano<br>
</div></div></blockquote></div><br><br clear="all"><br><br>