<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr" class="gmail_signature"><div>All,</div><div><br></div><div>This is the first time I have used a mailing list so I'm not sure how this will work out. I was trying to parallelize the rasterization of polygons with the method <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L630">GDALRasterizeGeometries</a>.  I was using an in memory raster that pointed to a data buffer and sent this to GDALRasterGeometries with all appropriate arguments. Everything worked fine and as expected when running with only 1 thread.  However, when moving to multiple threads I noticed that only 1 of the processors seemed to have any affect on the rasterization (meaning only the top half of the image was raterized and the rest was black.  Upon further inspection of the source code I think I found the culprit <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L772">here</a>.</div><div><br></div><div>The rasterization does not **directly** occur on the memory buffer from my passed data set. A chunk of memory is allocated dynamically and rasterizaton occurs on that memory. After rasterization this chunk of memory is then written to memory dataset I passed in</div><div><br></div><div>So using <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L630">GDALRasterizeGeometries</a> will not work. However upon further inspection I notice a really great <b>static</b> void function that it uses: <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L806">gv_rasterize_one_shape</a>. Upon further inspection it looks like it truly does just operate on the raw memory buffer for rasterization.  It of course calls alot of static functions through the process.</div><div><br></div><div>So the hope is that I can just loop through my geometries myself and call gv_rasterize_one_shape. Yes I understand that <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L630">GDALRasterizeGeometries</a> is doing an optimization of chunking and that I will have to do that myself when looping through geometries. However.... I see no gv_rasterize_one_shape function in ANY <b>header</b> files. I think it is somehow private or maybe unexposed and I can't really access it. </div><div><br></div><div>I am not much of a c++ programmer but I tried to trick the compiler by adding the function declaration in a header myself. However it complains that the symbol can't be found when compiling. Pretty normal makefile that does this: <span style="background-color:rgb(30,30,30);color:rgb(212,212,212);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";font-size:14px;white-space:pre">-L/usr/lib -lgdal</span></div><div><span style="background-color:rgb(30,30,30);color:rgb(212,212,212);font-family:"Droid Sans Mono",monospace,monospace,"Droid Sans Fallback";font-size:14px;white-space:pre"><br></span></div>I ran the following shell commands:</div><div dir="ltr" class="gmail_signature">objdump -t /usr/lib/libgdal.so ---- but no symbols were found<br></div><div class="gmail_signature">Its like the symbols have been stripped out of the shared library. Which I'm really confused because I figured you need the symbnols for linking...Like I said I'm no C++ expert.</div><div class="gmail_signature"> I tried /usr/lib/libgdal.a and the symbols are there but I dont think I want to static link.</div><div class="gmail_signature"><br></div><div class="gmail_signature">Anyways I guess I'm just wondering if there is any way for me to access  <a href="https://github.com/OSGeo/gdal/blob/master/gdal/alg/gdalrasterize.cpp#L806">gv_rasterize_one_shape</a>.</div><div class="gmail_signature"><br></div><div class="gmail_signature">Thanks for your help and this great library!</div><div class="gmail_signature"><br></div><div class="gmail_signature">Jeremy Castagno</div><div dir="ltr" class="gmail_signature"><br><div><br></div><div><br></div></div></div></div></div>