MapInfo Pro

 View Only
Expand all | Collapse all

Unable to created classified raster legend

  • 1.  Unable to created classified raster legend

    Posted 03-02-2022 12:36
    I have a classified raster which I have displayed in v2019.3 using Pseudo Color on the required band and the Advanced Color tool to create colours for each of the 21 classes according to the colour recipe I received with the data.

    Although in the Color window I can see these classes and their colours under the Breaks Table tab, I would like to create a Legend for this so that I can define what each of the classes means for those I share it with and to print the map for others.

    However, when I go to Create Legend, the only layers available are the vector layers on the map.  Could someone explain why I'm unable to do this for this data please? It's free UK Land Cover Map 2020 25m rasterised land parcelsIs there a way of doing it that I'm missing?

    Many thanks
    Jane

    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------


  • 2.  RE: Unable to created classified raster legend

    Employee
    Posted 03-03-2022 08:35
    Hello Jane,

    The reason why UK Land Cover file is not getting displayed in Create Legend window is because MapInfo Advanced is mounting the file as imagery and we don't support legend creation for imagery files. The UK Land Cover Map 2020 25m rasterised land parcels data is a tif file with 3 bands and as a result we mount it as imagery Raster.

    As a workaround you can use Calculator tool to extract the required band from the UK Land Cover file and mount it as a continuous Raster. Once done you should be able to Create Legend without any issues.
    Attaching screenshot below to for extracting a band through calculator tool:
    In the expression window if you want to extract 1st band type Input_1[1]. For Band 2 type Input_2[2].
    You will need to select the input file and make sure to Override output field type to "Continuous".

    Hope this helps.

    Thanks
    Anshul


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



  • 3.  RE: Unable to created classified raster legend

    Posted 03-03-2022 11:15
    Thanks Anshul - I didn't make it clear that I only have MapInfo Pro, not MapInfo Pro Advanced, so I don't have access to the functions of the Calculator tool.  Good to know that I'm not overlooking something though.

    Thanks for your help,
    Jane

    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------



  • 4.  RE: Unable to created classified raster legend

    Posted 03-03-2022 15:42
      |   view attached
    Hi Jane,

    There is a mechanism to load a GeoTIFF file as a Classified file. What you need is a GDAL PAMDataset auxiliary file (otherwise known as a raster attribute table or RAT file). If you have a TIF file called "LCM.TIF", then this auxiliary file would need to be called "LCM.TIF.AUX.XML". It would have the information in it to map from the band 0 values (1-21) to the classification color and label. If that file is present, then MapInfo would automatically load it. So, in theory, the EIDC ought to have shipped this file with the data package to support loading in MapInfo.

    However, I am not surprised that they did not ship this file because I suspect very few people in the world know how to make one. I sure as hell don't know. The utility GDALINFO seems like a good place to start - it will write one of these files. You can run it from QGIS, for example. However, the file it produces does not contain all the information you need. Maybe someone else can help.

    However, I can provide you with an alternative. You can create a virtual raster (MVR file) that classifies the TIF file on the fly. I have attached the MVR file, which you can save next to your TIF file. You just need to edit the MVR file with a text editor to make sure it has the right TIF file name. It is right at the top -

    <VirtualRaster>
    <Raster Name="UK Land Cover 25m" Filename="LCM.tif"/>

    You can load this MVR file into MapInfo just like it is a raster and it ought to display. I hope it works on 2019.3 - I have 2021. Also, I think it works even if you do not have the Advanced (raster plug-in). With Advanced you can run the Convert operation and convert the MVR to an MRR. I recommend doing this.

    ------------------------------
    Sam Roberts
    Founder, Roberts Geospatial Engineering
    Australia
    ------------------------------

    Attachment(s)

    zip
    Classify.zip   1 KB 1 version


  • 5.  RE: Unable to created classified raster legend

    Posted 03-03-2022 19:04
    A little update to this:

    I downloaded a portion of the dataset, but when you download the entire dataset it behaves differently. To use the same MVR trick on the full dataset you need to add some driver preference directives to force the TIFF driver in MapInfo to load the raster a certain way. The modified MVR is attached.

    I have also run the Convert operation on the full dataset and attached the classified MRR. Don't be surprised that the TIF is 4GB and the MRR is 44MB - compression is a useful thing. The EIDC make this data freely available but please note the attribution and licensing requirements. You can find them here. Here is a picture of the data draped on the 50m DEM for the UK.



    ------------------------------
    Sam Roberts
    Founder, Roberts Geospatial Engineering
    Australia
    ------------------------------

    Attachment(s)

    zip
    UK LandCover_EIDC2020_25m.zip   44.04 MB 1 version
    zip
    Classify_FullDataset.zip   1 KB 1 version


  • 6.  RE: Unable to created classified raster legend

    Posted 03-04-2022 11:31
    Many thanks Sam!  I shall have a look next week.
    Have a good weekend,
    Jane

    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------



  • 7.  RE: Unable to created classified raster legend

    Employee
    Posted 03-04-2022 02:47
    I think you might in fact be able to use the Convert operation with just MapInfo Pro.

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



  • 8.  RE: Unable to created classified raster legend

    Posted 03-04-2022 08:35
    We also had trouble with the raster version of this dataset (the 100 metre version).
    Instead, we downloaded the vector version, in GeoPackage format.  We created an FME workspace to crop to our area of interest (Northern England), and output a styled MapInfo .tab file.  This vector version worked okay.


  • 9.  RE: Unable to created classified raster legend

    Posted 03-04-2022 11:33
    Sounds good Peter - I think you pay for that though, don't you?
    Thanks,
    Jane

    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------



  • 10.  RE: Unable to created classified raster legend

    Posted 03-08-2022 18:01

    Sorry Jane, I was thinking of a different Land Cover map.

    The WMS layer displays fine in MapInfo, but the legend isn't feeding through for me.  One option would be to download the following legend, and add it to the layout as an image:

    https://catalogue.ceh.ac.uk/maps/51bcb92a-dd88-4034-ba65-a9d432dd632a?language=eng&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=WMS&format=image/png




  • 11.  RE: Unable to created classified raster legend

    Posted 03-15-2022 05:50
    Thanks Peter, yes, that's the thing, getting the legend even though I can load a classified raster - I had thought I'd best do something similar so thanks for the link to the legend image.

    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------