[Gdal-dev] Mosaicking MOD44W landmask (318 geotiffs)

orbiter_postmuch dan0225 at sbcglobal.net
Fri Sep 25 02:49:14 EDT 2009


After nabble decides to crash, I have to post this message all again.

I tried this script to mosaick the 318 tiffs:

@echo off
:: initial version, 2005-Nov-17, matt wilkie 
:: this script is public domain 
if [%1]==[] ( 
        echo. 
        echo -={ gdal_wildmerge }=- Allow gdal_merge to accept wildcards for
input files 
        echo . 
        echo .  gdal_wildmerge.bat [*.tif] [merge.tif] {options} 
        echo .  
        echo .  gdal_wildmerge c:\BM_T\MRT_download_Win\MRT\bin\318\*.tif
merge.tif -init -9999 
        echo. 
        goto :EOF 
        ) 
        :: %1 is the input wildcard mask 
        :: This is inverted from normal gdal_merge usage in order to allow
other 
        :: options be passed to gdal_merge 
 
 
:: delayed expansion requires windows NT or later command shell  
:: (it won't work on windows 9x) 
        verify other 2>nul  
        setlocal ENABLEDELAYEDEXPANSION  
        if errorlevel 1 goto :wrong_version 
 
:: gdal_merge won't overwrite an existing file   
        if exist %2 goto :file_exists 
 
:: Build the input file list 
        set infiles= 
        for %%a in (%1) do set infiles=!infiles! "%%a" 
 
:: Here is were the actual work happens 
        set gdalcmd=gdal_merge %infiles% -o "%2" 
   echo %gdalcmd% 
   :: IMPORTANT, if gdal_merge is not call'ed control doesn't return  
        :: to the batch file 
        call %gdalcmd% 
        goto :EOF 
 
:file_exists 
        echo *** the output file "%2" already exists. 
        goto :EOF 
 
:wrong_version 
        echo. 
        echo    Sorry, this batchfile requires DELAYED EXPANSION which is  
        echo    not available in this shell. See  
        echo  http://www.google.com/search?q=enabledelayedexpansion 
        goto :EOF

And the command line repeats this:

-={ gdal_wildmerge }=- Allow gdal_merge to accept wildcards for input files 

gdal_wildmerge.bat [*.tif] [merge.tif] {options} 
          
gdal_wildmerge c:\BM_T\MRT_download_Win\MRT\bin\318\*.tif merge.tif -init
-9999

It was supposed to build a mosaic list, but it never did.

If the program does manage to mosaick the files, the next problem would be
on how to open the resulting 200000+ pixel image.
-- 
View this message in context: http://n2.nabble.com/Mosaicking-MOD44W-landmask-318-geotiffs-tp3710710p3710710.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list