MapInfo Pro

 View Only
  • 1.  Errors Uber H3 Hexagon layers in MapInfo Pro

    Posted 03-15-2023 13:28

    Hi,

    I read the discussion entitled "MapInfo Monday: Creating Uber H3 Hexagon layers in MapInfo Pro". In that post it mentions running MapInfo as admin and allowing the ad-in to install H3 Python Library. After opening MI as admin, then running CreateUberH3Hexagons.py (from Home>Open>Program) I'm still getting the following errors. Can you please provide guidance to resolve? Thank you - Kathy

    ERRORS: module 'h3' is not installed. It will be installed
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/h3/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/h3/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/h3/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/h3/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/h3/
    ERROR: Could not find a version that satisfies the requirement h3 (from versions: none)
    ERROR: No matching distribution found for h3
    ModuleNotFoundError : No module named 'h3'

     



    ------------------------------
    Kathy Gillis
    AT&T
    SAN RAMON OR
    ------------------------------


  • 2.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Employee
    Posted 03-17-2023 08:59

    Hi Kathy

    Can you try loading MapInfo Pro with administrator right? Right-click on your MapInfo Pro shortcut and use Run as Administrator.

    Now try to load the H3 Hexagon tool again.



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



  • 3.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Posted 03-17-2023 19:10

    Thank you Peter. 

    I am having the result when running as admin.

    MapInfo Pro 2021 build 183.

    Any other ideas for resolution? Thanks for your time - Kathy



    ------------------------------
    Kathy Gillis
    AT&T
    SAN RAMON OR
    ------------------------------



  • 4.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Employee
    Posted 03-20-2023 03:46

    Hi Kathy

    The H3 tool seems to be failing to install the H3 Python module. Maybe we can try to get that installed "manually".

    Open the Command Prompt by typing CMD in the search field with the Window Start button.

    Now change the directory to the folder where you have MapInfo Pro installed.

    Now change the folder to the PythonXXX subfolder. I think it's Python310 but I'm on MapInfo Pro v2021.1, and I can't recall if we change the Python version between 2021 and 2021.1 so check what your folder name is.

    Now type this to get the H3 module installed: python -m pip install h3

    As you can see I got a message telling me I already had that module: Requirement already satisfied
    You may have to launch the Command Prompt as Administrator. This post (see the second thread) has a more thorough description on how to install a Python Module with Pip from the Command Prompt.
    Now try to run the tool again in MapInfo Pro.


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



  • 5.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Posted 03-20-2023 19:14
      |   view attached

    Thank you Peter. I did get the package to install and run. I'm executing the script with the attached tab file of the U.S.. It is taking a very long time for resolution 9 (only one I have tried thus far). Should it be taking hours to produce the output file?

    Thank you for all of your help, Peter - Kathy



    ------------------------------
    Kathy Gillis
    AT&T
    SAN RAMON OR
    ------------------------------

    Attachment(s)

    zip
    States_Comb.zip   17.40 MB 1 version


  • 6.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Employee
    Posted 03-21-2023 06:06

    It may take hours, yes.

    I tried creating H3 Level 5 for your data. That took around 5 minutes to create 36,388 hexagons.

    I then took it up a level and set it to create level 7 hexagons. This took 177 minutes and resulted in 1.781,416 hexagons.

    Remember for each step down in size, you get 7 times more hexagons. I can see the times isn't a multiply of 49 for my 2 steps. It's only took around 35 times longer to generate level 7 compared to level 5.

    If we extrude this to generate level 5. It will probably take around 35 * 177 minutes ~ 6,200 minutes ~ 103 hours - jaw dropping. I hope I made som miscalculations here



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



  • 7.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Posted 03-21-2023 15:47

    Thank you, Peter. I really appreciate your help through this.

    Kathy



    ------------------------------
    Kathy Gillis
    AT&T
    SAN RAMON OR
    ------------------------------



  • 8.  RE: Errors Uber H3 Hexagon layers in MapInfo Pro

    Employee
    Posted 03-22-2023 06:48

    I looked a bit closer at the numbers, and it seems the time is spent on figuring out which hexagons to create. Actual creating the hexagons takes around 10 minutes.

    The problem is your complex regions with many holes and islands and generally many nodes.

    I simplified the regions by adding a 200 km buffer and then adding a -200 buffer around the area. This will smooth out the polygons. But keep a polygon that is close to the coverage of the original:

    Update States_Comb
      Set OBJ = Buffer(Buffer(Obj, 4, 200000, "m"), 4, -200000, "m")

    Running the tool on the simplified boundaries took a shorter time. It now processes all 2,009,392 hexagons in around 45 minutes - compared to 177 minutes earlier.



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