There's more to experience when you log in!
Being driven by the continuous inputs from our industry partners and customers, MapInfo Pro 17.0.3 extends the existing Add-In model to include support for Add-Ins written in the Python language.
Python is much more than just a scripting language and enabling the developer community to incorporate use of their own Python environment modules directly into the MapInfo Pro application environment talks about the health of the product and the growth prospects for the MapInfo Pro user.
With the changes in the MapInfo Extensibility model, the Python Add-In developers will have access to the development interface for bringing in their own apps into the product, add ribbon interface, create commands, and this is just the beginning! While users can make use of any of the libraries and functionality available to Python, the ability to perform data analysis on MapInfo Pro table attribute data using the rich set of available Python data analysis tools (e.g., pandas, SciPy, matplotlib) will be very useful to many in the community. Python developers will be able to build the Add-Ins using their own Python 3.7 development environment. The ease of Python language, its high portability and use across platforms and high scalability makes it an excellent choice to extend support.
Setting Up MapInfo Pro Python Add-in
This can be done in a few simple steps.
Note: Make sure to use the Windows x86-64 executable installer under Downloads.
Machine Environment Setup:
Set the SYSTEM environment variable "PYTHONHOME" to the Python installation directory (C:\Program Files\Python37)NOTE:
With the Python setup done, you can start creating your own add-ins.
The MapBasic 17.0.3 installation contains two python add-in templates for creating a simple MapInfo Pro add-in or a layout custom frame add-in in python.
Use one of the existing python add-in templates to start.The above snapshot shows a MapInfo Table file of a region in Australia. Using the GDAL/OGR module in python we have created a scatter plot showing the weekly rent against the total household income of a demographic data.
This has been included as one of the samples - SAMPLES\RIBBONINTERFACE\Python\py_addin_gdal
Using the available Python modules like pandas, SciPy, matplotlib and GDAL/OGR module for accessing MapInfo table data for analysis, data conversion and management, can help increase productivity.
With different datasets opened in MapInfo Pro, any attribute can be accessed, graphs plotted and charts created with the power of Python!Tagging @Anshul Goel
To install Python Bindings for GDAL without network you would have to provide the customer with the copy of "GDAL‑3.0.0‑cp37‑cp37m‑win_amd64.whl" from https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal website.
Once they have the wheel file on there machine, they would have to open Administrator command prompt and execute "pip install <path to GDAL‑3.0.0‑cp37‑cp37m‑win_amd64.whl>".
This will install GDAL python Bindings, which will allow them to open Native Tab files using MITAB driver only.Before doing this, make sure they have Python 3.7 x64 installed and all setup done as mentioned in MapInfo Pro v17.0.3 release notes.Note : wheel file customer will be installing is created by Opensoure 3rdParty and is not part of MapInfo Pro.
GDAL‑3.0.0‑cp37‑cp37m‑win_amd64.whl is no longer available on www.lfd.uci.edu (latest is 3.0.2). If you still need 3.0.0, you will have to install/build from source following the instructions at https://support.pitneybowes.com/SearchArticles/VFP05_KnowledgeWithSidebarHowTo?id=kA11E000000TNmcSAG&popup=false;&lang=en_US
However, the pip command on that page is incorrect. If you installed GDAL using OSGeo4W to "C:\OSGeo4W64" then the pip command to install the python package is:python -m pip install --global-option=build_ext --global-option="-IC:\\OSGeo4W64\\include" --global-option="-LC:\\OSGeo4W64\lib" GDAL
python -m pip install --global-option=build_ext --global-option="-IC:\\OSGeo4W64\\include" --global-option="-LC:\\OSGeo4W64\lib" GDAL
If you happened to install the binaries for GDAL 3.0.0, then the above command is:
python -m pip install --global-option=build_ext --global-option="-IC:\\OSGeo4W64\\include" --global-option="-LC:\\OSGeo4W64\lib" GDAL==3.0.0
Important: You will need the MapBasic 17.0.3 installation to access the samples mentioned above.