Sample Python add-in script to convert geojson to FeatureGeometry via MDAL with MapInfo Pro extensibility

products affected: MapInfo Pro™
The attached example Python script, mdalfeaturegeometryfromgeojson.py, can be used with MapInfo Pro extensibility to convert a geojson file to a FeatureGeometry for use in MapInfo Pro.

import clr
clr.AddReference("MapInfo.CoreTypes")
clr.AddReference("MapInfo.DataAccess")
clr.AddReference("MapInfo.Ogc.DataAccess")
from MapInfo.Ogc import FeatureGeometryFactory
from MapInfo.Geometry import CoordSys
from MapInfo.Engine import Session

myGeoJSON = '{"type":"MultiPolygon","coordinates":[[[[-96.16112799999999,31.72572],[-96.16165199999999,31.725734],[-96.16165,31.726202999999998],[-96.16113299999999,31.726212999999998],[-96.16113,31.726056999999997],[-96.161127,31.725747],[-96.16112799999999,31.72572]]]]}'
session = None
try:
    session = Session.Current
    if session:
        defaultCsys = Session.Current.CoordSysFactory.CreateCoordSys("EPSG:4326")
        if defaultCsys:
            geometryFactory = FeatureGeometryFactory(defaultCsys)
            if geometryFactory:
                featureGeometry = geometryFactory.FeatureGeometryFromGeoJson(myGeoJSON)
                if featureGeometry:
                    print("passed")
finally:
    if session:
        Session.Dispose()
        session = None
UPDATED:  June 17, 2020