<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi all,</div>This is also possible with the dem_mosaic tool, part of the NASA Ames Stereo Pipeline toolkit. The utility is multithreaded and meant to handle an arbitrary number of large rasters efficiently. You want the ‘—max’ command line option.<div class=""><br class=""></div><div class="">Unfortunately, the official NASA ASP site is currently down, but you can download precompiled binaries for Linux and OS X here: <a href="https://github.com/NeoGeographyToolkit/StereoPipeline/releases" class="">https://github.com/NeoGeographyToolkit/StereoPipeline/releases</a>. See the asp_book.pdf for documentation and usage on dem_mosaic.</div><div class=""><br class=""></div><div class="">Hope that helps.<br class=""><div class="">-David<br class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 20, 2017, at 1:48 PM, Nicolas Cadieux <<a href="mailto:nicolas.cadieux@archeotec.ca" class="">nicolas.cadieux@archeotec.ca</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">Hi,</div><div class=""><br class=""></div><div class="">You may be able to do that with the Saga grid mosaic. You can select ´max’ for overlapping areas. </div><div class=""><br class=""></div><div class=""><a href="http://www.saga-gis.org/saga_tool_doc/2.3.0/grid_tools_3.html" class="">http://www.saga-gis.org/saga_tool_doc/2.3.0/grid_tools_3.html</a></div><div class=""><br class=""></div><div class=""> Nicolas</div><div class=""><br class="">Le 17 nov. 2017 à 15:05, Rousseau Lambert2, Louis-Philippe (EC) <<a href="mailto:louis-philippe.rousseaulambert2@canada.ca" class="">louis-philippe.rousseaulambert2@canada.ca</a>> a écrit :<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><span class="">Hi everyone,</span><br class=""><span class=""></span><br class=""><span class="">I would like to have your opinion on some processing I have to do. </span><br class=""><span class=""></span><br class=""><span class="">So I have to merge many rasters (eventually more then 50). Some overlaps</span><br class=""><span class="">(never completely), but others don't, my files when merged cover Canada.</span><br class=""><span class="">I have to keep the maximum value where there is some overlap between</span><br class=""><span class="">different files.</span><br class=""><span class=""></span><br class=""><span class="">My first try was to use gdal_calc with --calc="maximum(A,B)", but it can</span><br class=""><span class="">only input 26 files at a time. And The output of gdal_calc is only the</span><br class=""><span class="">region of overlap, in my case I have to keep the whole extent of my</span><br class=""><span class="">rasters, not only the region of overlap... Is there a way I could use</span><br class=""><span class="">gdal_calc and keep everything, not only the overlap?</span><br class=""><span class=""></span><br class=""><span class="">My second try was to use gdalwarp with a vrt of all my files as input</span><br class=""><span class="">and use -r max for my resampling. My results were that it only</span><br class=""><span class="">overlapped my geotiff and did not took the maximum value.</span><br class=""><span class=""></span><br class=""><span class="">My last try, was to use gdalwarp to ensure that all my files have the</span><br class=""><span class="">same extent and that pixel overlap perfectly. Then I create a mosaic</span><br class=""><span class="">using gdal_merge of all my rasters. At this point I don't manage yet the</span><br class=""><span class="">maximum value. Then I loop trough all my geotiff using gdal_calc to</span><br class=""><span class="">output the overlap region between one geotiff and my mosaic. then I can</span><br class=""><span class="">merge the overlap region with my mosaic. Finally I get a mosaic of the</span><br class=""><span class="">maximum value where my raster overlap.</span><br class=""><span class=""></span><br class=""><span class="">I don't really like this solution because if I have 50 files, I have to</span><br class=""><span class="">use gdal_calc 50 times and merge the result 50 times... That seems a lot</span><br class=""><span class="">of processing to simply get the maximum value in a mosaic.</span><br class=""><span class=""></span><br class=""><span class="">Can you think of a better way to do? Any thoughts or opinions are welcome!</span><br class=""><span class=""></span><br class=""><span class="">Louis-Philippe R. Lambert</span><br class=""><span class=""></span><br class=""><span class="">_______________________________________________</span><br class=""><span class="">gdal-dev mailing list</span><br class=""><span class=""><a href="mailto:gdal-dev@lists.osgeo.org" class="">gdal-dev@lists.osgeo.org</a></span><br class=""><span class=""><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" class="">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></span></div></blockquote></div>_______________________________________________<br class="">gdal-dev mailing list<br class=""><a href="mailto:gdal-dev@lists.osgeo.org" class="">gdal-dev@lists.osgeo.org</a><br class="">https://lists.osgeo.org/mailman/listinfo/gdal-dev</div></blockquote></div><br class=""></div></div></div></body></html>