MapInfo Pro

 View Only
  • 1.  MapInfo Monday: Merging Raster Files Virtually in MapInfo Pro v2021

    Employee
    Posted 10-08-2021 02:00

    Happy #MapInfoMonday on this wonderful Friday. I hope you have enjoyed a full week of #MapInfoMonday articles. Next week, we are back at one article a week.

    ​Today we will look at MapInfo Virtual Rasters.

    A MapInfo Virtual Raster is a set of instructions stored in an XML file that gives MapInfo Pro Raster commands to process one or multiple input raster into a virtual output raster. The MapInfo Virtual Raster, or in short MVR, can be opened into MapInfo Pro like a normal MRR file.

    MVR data is cached by the raster engine just like any other raster data. If the requested data is not in the cache, then the virtual raster engine will be invoked to provide the data. Source rasters for an MVR should be MRR or have overview cache files.

    You can load, display, and operate upon an MVR in MapInfo Pro just like any other regular raster format. For now, the number of operations that support MVR is however limited. This will get extended over the coming versions. You can visualize an MVR in a map window, query the cell values using the Cell Value tool, and you can crystalize an MVR into an MRR or other support formats when needed.

    Creating an MVR using Merge

    Merging multiple raster files into a single raster can be time-consuming if you want to create a physical MRR on your hard drive. For large areas at high resolution, this can take hours.

    Merging raster files into a virtual raster on the other hand typically takes less than an hour.

    In this example, we will merge four raster files into one MVR just to show you the process, and the result.

    From the Raster Operations on the Raster tab, select the Merge operation.


    Start by checking the Create MVR option at the top of the Merge window. This goes for all the operations that allow you to create an MVR. The Merge window is changed slightly as the options adapt to creating an MVR instead of a "normal", physical raster.

    I have opened the raster files I want to merge into a map window in MapInfo Pro. You can however also select the files via the Browse option in the Merge window.

    Notice how the color for the four raster files doesn't align across the borders between these raster files. That's because the minimum and maximum values in these raster files aren't the same and so the colors aren't assigned to the same values when spread across the values in each raster file.


    As I know the raster files don't overlap, I have chosen the Stamp from the list of Merge Operators.

    I also specify the name for my MVR, and then I hit Process.

    As you can see in the image below, the new MapInfo Virtual Raster is created in less than a second, and then opened into my map window. Notice that the colors are now spread evenly across the MVR. MapInfo Pro still has the four individual raster files open but you can in fact close these.

    The Content of the MVR file

    Sorry but now it gets a bit technical. Let's look at the MVR file we generated. As I said earlier it's an XML file which means we can open it in a text editor and have a look at the content.

    This is the content of the MVR we created earlier.

    <VirtualRaster Version="1.0">
    	<Raster Name="Raster_Merge_0" Filename="./DSM_611_86.mrr"/>
    	<Raster Name="Raster_Merge_1" Filename="./DSM_611_87.mrr"/>
    	<Raster Name="Raster_Merge_2" Filename="./DSM_612_86.mrr"/>
    	<Raster Name="Raster_Merge_3" Filename="./DSM_612_87.mrr"/>
    	<RasterOperationList Enable="True" Name="Merge">
    		<Description>MapInfo Merge Operation</Description>
    		<Merge Enable="True" Name="MergeOperation">
    			<UnderviewInterpolation>Nearest</UnderviewInterpolation>
    			<InterpolationNearest>False</InterpolationNearest>
    			<UseSourceDataType>True</UseSourceDataType>
    			<CellCombineRule>Last</CellCombineRule>
    			<MergeBoundingBox>RasterUnion</MergeBoundingBox>
    			<Layer>
    				<Raster Name="Raster_Merge_0" Field="0" Band="0"/>
    			</Layer>
    			<Layer>
    				<Raster Name="Raster_Merge_1" Field="0" Band="0"/>
    			</Layer>
    			<Layer>
    				<Raster Name="Raster_Merge_2" Field="0" Band="0"/>
    			</Layer>
    			<Layer>
    				<Raster Name="Raster_Merge_3" Field="0" Band="0"/>
    			</Layer>
    		</Merge>
    	</RasterOperationList>
    	<RasterInfo>
    		<FieldInfo>
    			<Operation Name="MergeOperation"/>
    		</FieldInfo>
    	</RasterInfo>
    </VirtualRaster>​


    I will not go into details about the individual elements of the file. You can see it refers to a number of input raster files at the top, it describes which operation to use, and how to match the fields and bands of the input raster files.

    You could write this file yourself and open it into MapInfo Pro as a raster. This would tricker MapInfo Pro to create the matching tab file and necessary accompanying files. 

    Besides merging raster files into an MVR, MapInfo Pro v2021 also lets you create MVRs via the Resample and Reproject operations. We are looking to extend these operations as well like we also want to be able to use MVR files as input for more operations.

    Which operations would you like to see support of MVR either as input or as output?



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------


  • 2.  RE: MapInfo Monday: Merging Raster Files Virtually in MapInfo Pro v2021

    Posted 10-11-2021 10:51
    Is this similar to a Seamless Table then, Peter?
    Obviously it does more than that.

    ------------------------------
    John Ievers
    CDR Group
    Hope Valley, United Kingdom
    ------------------------------



  • 3.  RE: MapInfo Monday: Merging Raster Files Virtually in MapInfo Pro v2021

    Employee
    Posted 10-12-2021 01:49
    It's more and less than seamless tables, John.

    Seamless tables support a number of features that MapInfo Virtual Raster donøt, such as: referencing vector tables and defining zoom levels to control when to display a table referenced in the seamless table.

    A MapInfo Virtual Raster on the other hand allows you to manipulate the input raster so that it displays other values through the MVR. As I wrote above we have just started this journey and we will be adding more capabilities to the user interface in support of virtual rasters.

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------