MapInfo Pro Developers User Group

 View Only
  • 1.  Create Raster automation using C#

    Posted 12-06-2022 14:07


    I'm working on automating the process of creating a raster (MRR) files from txt bathymetry file
    We are using Minimum Curvature method, cell as parameter units, and setting cell size manually, please see attachment

    While I'm getting a result similar to one produced by using the standard MapInfo UI, some resulting raster details are slightly  different, in a way that makes it unusable.

    My goal is to set the processing parameters in the code to match exactly the processing by standard MapInfo UI

    Some properties which DO match:

    Current Projection
    Raster Size
    File Extension
    File Format
    File Driver

    Here are examples of parameters which DO NOT match between the raster produced by standard MapInfo UI and by my C# code:

    Cell size  ( X and Y)
    Spatial Bounds
    Base Level Tile Size (Hight and Width)
    World Origin ( X and Y)


    As for "Cell Size X" and "Cell Size Y" , the Raster Info for the MapInfo UI produced MRR has nominal size set in the "Cell Size" interpolation window, but the MRR produced by my C# code has it slightly different ( by much less than 1%).


    Same goes to "Spatial Bounds", "World Origin X" and "World Origin Y": they are very close but different by ~0.5 meter (raster covers ~20 km)


    As for "Base Level Tile Size" it's 1024 for standard MapInfo UI generate files, and 256 for automated processing

    I'd like to know how to set programmatically those (and may be other) parameters to match the standard MapInfo processing.

    I suspect that the spatial Bounds and World Origin is most important for me

    We're using MapInfo Pro Version 2021.1, Release built 25

    References in C# project: MapInfoRasterEngin.Common, MapInfo.RasterEngine.Operations

    Runtime Version v4.0.30319


    Any help  will be appreciated!

     Thank you in advance

    Igor Umansky
    Knowledge Community Shared Account
    Shelton ON

  • 2.  RE: Create Raster automation using C#
    Best Answer

    Posted 12-08-2022 16:51
    Hello all interested in the subject

    I found the issue and it was difference in smoothing type, should've set None (and not Average)

    Thank you all

    igor Umansky
    Knowledge Community Shared Account
    Shelton ON