I have been asked to share a bit more details on how to create this in MapInfo Pro.
First, let me state that the script I have shared does require
MapInfo Pro v2019.3.
So I have attached a zip file to this response holding the data and the Python script that I used.
Now even though MapInfo comes with Python preinstalled these days including a number of often-used Python libraries, it's still necessary to install a couple of other modules used in my script for creating the GIFF.
Here's how you do that:
1. Open the Command window by typing "CMD" in the
Search field next to the
Start button in Windows and hit
Enter.
3. Now type:
CD C:\Program Files\MapInfo\Professional\Python37, where C:\Program Files\MapInfo\Professional is the MapInfo Pro installation folder. In my case, that folder is C:\MapInfo\Pro x64\19.0. Then hit
Enter.
This moves you into the Python folder for MapInfo Pro which is necessary to be able to install the needed Python libraries.
4. Now it's time to install the libraries. This is done by entering two statements, one at a time. Each statement will download and install a Python library. These are the statements:
python -m pip install imageio
python -m pip install Pillow
If you don't already have these modules installed, you can see how they get downloaded and installed. In my case, you can see that the libraries already are installed (requirements are already satisfied.).
5. Close the Command window either through the X in the order or by running the
Exit command.
Now the Python requirements are in place.
Unzip the attached file.
Start MapInfo Pro, and open the table
Lightnings_20020618 from the attached zip file into a map window. You can also add a background map if you want to. Note that the extent and size of the map are used for the images in your GIFF. Now turn off the visibility of the Lightning table as the script will add a part of the bolts of lightning to the map as it runs through the day.
Open the
Python console from the
Tool Windows dropdown.
Open the file
Visulize Lightnings.py in a text editor, copy the content, and paste it into the
Python Console.
As the script prints some messages to the
Message window I'd recommend opening that window before running the script. Otherwise, it might open and change the size of your map window. You can open the
Message window from the
Tool Windows dropdown.
You also need to open the table
Time_Title from the attached zip file. It shows a point that you should label with the column TimeStamp. You can also change the label properties to make it stand out on your background. The point can be moved to any location you want. Save changes to the table when done.
Now click inside the Python Console to give this window focus, and then Hit Ctrl + Enter on your keyboard to start the script.
As it loops through the day, you will see the bolts of lightning appear and move across the map. In the
Message window, you can see how far it is in the process.
When the script has finished, you can find the final GIFF, called 20020618.gif, in the same folder as you put the table
Lightnings_20020618.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------