apply formula (raster calculator) between two files

suzukisuzuki Global Mapper UserPosts: 6
some questions about apply formula (raster calculator)

i have 2 files (elevation Geotiff format) File01.tif and File02.tif
each file has only one band, and same pixel size

is it possible to use "raster calculator" or "apply_formula script" do some calculation between two file (not one file two bands)
such as :

output = File01/ File02

"output" is what i want

Best regards 

Best Answers

  • JeffH@BMGJeffH@BMG Global Mapper Developer Posts: 269
    Answer ✓
    Hi suzuki,

    Sorry to be so slow answering you - I missed this question somehow.

    As far as I know, there's no way currently to do this: you'd need to combine the two bands into one raster layer, and then do the operation.

    I've added a new feature request (#20821) for this functionality, and we'll be evaluating it for inclusion in a future Global Mapper release. We'll reply here when we've added it.

    Thanks for the suggestion & best regards,

  • JeffH@BMGJeffH@BMG Global Mapper Developer Posts: 269
    Answer ✓
    Hi again,

    Oops, a little red-faced here. You should be able to load multiple images and select bands from whichever layer you like, and the calculations will proceed. It looks like the calculator will take the largest image dimensions to do the calculations over, but if your images are the same size, it should work just fine.



  • I have a follow up on the same question: I have several (10+) fiiles that are DEMS (one band with elevation). I'd like to calculate the average and standard deviation, but I don't know what the syntax is for writing the formula...specifically, how to reference each file. Fore example, to calculate the mean of two files, do I write:

    (file1 + file2 )/2.  ?

    How best to script it? I imaging I want to save the running sum and sum of squares.

Sign In or Register to comment.