MapInfo Pro

Expand all | Collapse all

KML/GeoJSON Colours

  • 1.  KML/GeoJSON Colours

    Posted 08-14-2019 08:28
    I have a TAB and Map from a Shapefile. There are two categorys of information within the TAB, and I would like to colour code these to show on the Map. I have been able to create 2 querys into one map to colour code these in MapInfo Pro. However, when exported as a KML and put into Google Earth these colours do not show - it is black and white. Similarly, when converted from KML to GeoJSON, the colours are also not there. There is a site where you can select each polygon and change the colour in a GeoJSON, however this is a very long process. I have tried changing the code in Visual Studio Code without success.

    Can someone guide me in the right direction to be able to input colours, please?

    Many thanks

    ------------------------------
    Lucy
    ------------------------------


  • 2.  RE: KML/GeoJSON Colours

    Posted 08-14-2019 23:33
    Hi Lucy,

    1. If you are still reading directly from a shapefile, it will be read-only so save-copy-as to a TAB file and open this in MapInfo
    2. Change the 'base' colour of the objects in MapInfo (set the layer to be editable, select the records which meet your criteria, change the style. Repeat for your 2nd category with a different style etc). Save your table (edits).
    3. On the map, select all the objects in the layer
    4. Run the GELink tool, select Export Map Image or Current Selection, choose Export selected objects (KML) when asked
    5. Select the output path, file name and any other settings required, press OK

    The layer should open in Google Earth, using the colours from the MapInfo TAB file. Let us know if you need any extra info on the above steps.

    Tim

    ------------------------------
    Timothy Mashford
    Knowledge Community Shared Account
    Shelton CT
    ------------------------------



  • 3.  RE: KML/GeoJSON Colours

    Posted 08-15-2019 04:15
    Hi Timothy,

    Thank you for your message. I have been ale to follow it up to step 2. When I change the region/line style colour, it changes this for everything rather than just the information I have selected? I have tried putting the categories into two table browsers, but merged into one map - however this still does not work e.g. if i change browser A to blue, it will also change browser B to blue.

    Also, my 'save' button in the Table tab is greyed out so this may be why the colours do not go onto the map? I have tried exporting and opening again but it seems to be reoccurring.

    I continued the further steps to test it but unfortunately colours did not show on Google Earth.

    Thanks,

    Lucy

    ------------------------------
    Lucy
    Shelton CT
    ------------------------------



  • 4.  RE: KML/GeoJSON Colours

    Posted 08-15-2019 23:30
      |   view attached
    Hi Lucy,

    I'm not sure where/if you're doing something incorrectly, it depends e.g. how you're changing the styles.

    I've written up some quick instructions and attached, let me know if it works?

    Also make sure after doing 'save copy as' you close the original table (TABLE -> Close) and then open the new copy.

    ------------------------------
    Timothy Mashford
    Melbourne, Australia
    ------------------------------

    Attachment(s)

    pdf
    edit_object_styles.pdf   162K 1 version


  • 5.  RE: KML/GeoJSON Colours

    Posted 08-16-2019 05:34
    Hi Lucy
    It does sound like you are just doing a Style Override in the Layer Control rather than making a permanent change to the table. Tim's instructions explain how go about that.

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