MapInfo Pro

MapInfo Monday: Finding thistles in a field

  • 1.  MapInfo Monday: Finding thistles in a field

    Posted 11-19-2020 03:28

    Happy #MapInfoMonday!

    Today we'll dive a bit into the power of using raster analysis in MapInfo Pro Advanced.

    Last week Rita Hørfarter from SEGES, who focuses on providing sustainable solutions for future farming in Denmark, reached out with a question related to using the Raster Calculator in MapInfo Pro Advanced.

    She has been given the task of identifying areas in a field with a high population of thistles. She had been given a 5GB TIFF covering a 40-hectare field with a resolution of 2.5 cm. The data was captured by a drone.

    Below you can see this raster grid clipped to the borders of the 40-hectare field.

    No alt text provided for this image

    The TIFF raster grid contained four bands, and Rita's question was only around using these bands in the Raster Calculator in MapInfo Pro Advanced.

    A raster grid with multiple bands can be displayed in a couple of ways in MapInfo Pro. You can display it using the RGB method as you can see below where you assign each band to the colors Red, Green, and Blue. In the case where you assign the actual values from the bands red, green, and blue to these, the result will be like an aerial image of the area.

    No alt text provided for this image

    You can also switch to the Pseudo mode where you only represent a single band when viewing the raster grid. In the example below, you can see how Rita has switched to Pseudo and chosen to display the values from the Green band.

    No alt text provided for this image

    Back to the real purpose of the exercise here: locating areas with a high population of thistles. Rita knew how she could highlight the areas where the population of thistles probably would be high. She wanted to use an expression using the three color bands to find these. The expression was this:

    2 * Green - Red - Blue

    She wanted to create a new raster using this expression in the Raster Calculator.

    To reference a band in a raster grid, you can type "[" after the raster, or after the Input variable referring to the raster grid. This will pop up a list of bands in the raster grid. When you select one of these bands, MapInfo Pro will insert the band number in the expression.

    In Rita's case the original expression ended up looking like this:

    Input_1[2] * 2 - Input_1[1] - Input_1[3]

    where Input_1 refers to the raster grid.

    No alt text provided for this image

    To find the location with a high population of thistles, she was looking for the grid cells where the expression above was higher than 60 or 70. Below you can see an image showing an area with the values being higher than 60 and higher than 70.

    No alt text provided for this image

    And finally, here is an image showing the potential areas with many thistles in the entire field. In the image below the threshold has been set to 60.

    No alt text provided for this image

    Thanks for sharing this use case of MapInfo Pro Advanced, Rita.

    If you have other interesting use cases of MapInfo Pro or MapInfo Pro Advanced, that you'd like me to cover to not hesitate to reach out. I'd be happy to cover these in an upcoming #MapInfoMonday post.

    PS: Did you know that the thistle is the national flower of Scotland? Apparently, it saved a Scottish army's encampment from being taken by surprise by a Norse army one night back in the days according to Wikipedia.

    This article was initially posted on LinkedIn.

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