MapInfo Pro

 View Only
  • 1.  raster calculator

    Posted 11-14-2021 03:31
    Hi
    I have used the following expression in the ArcGis Pro raster calculator:
    Con(IsNull( "raster1.tif"), FocalStatistics( "raster1.tif", NbrRectangle(5,5, "CELL"), "Majority"),  "raster1.tif")

    The idea is to use a majority filter in a 5x5 system only for pixels without a value.

    Does the MapInfo raster calculator also allow you to use filters in a similar way? What might this expression look like?

    All the best
    Tambet Kikas


  • 2.  RE: raster calculator

    Employee
    Posted 11-14-2021 08:18
    Hello Tambet,

    Currently MapInfo raster calculator doesn't support Focal filter function.
    We can achieve it through MapInfo raster as a 2 step process. 1st step would be to run Filter tool (Raster->Raster Operations->Filter) on raster1.tiff. In "Filter" tool select "Focal Filter" in category and filter as "Majority". Rows and Columns will be 5x5. Once the output is generated, we can write a simple expression in calculator to replace all null cells in original raster with values in the focal filter output.
    Filter Tool:


    Calculator:
    Output generated through calculator tool should be the expected output.

    The same can also be achieved programmatically using Raster SDK .NET. We can write a program to 1st call focal filter operation and then call calculator operation.
    Hope this helps.

    Thanks
    Anshul

    ------------------------------
    Anshul Goel
    Pitney Bowes Software Inc.
    Shelton CT
    ------------------------------



  • 3.  RE: raster calculator

    Posted 11-14-2021 12:38
    Thank you!
    This solution also works well in this case.

    All the best
    Tambet Kikas


    ------------------------------
    Tambet Kikas
    GallusGeo OÜ
    Kuressaare
    ------------------------------