Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError When Plotting Mesh with Cell Boundary on Antimeridian #61

Open
gecoombs opened this issue May 15, 2024 · 2 comments
Open

TypeError When Plotting Mesh with Cell Boundary on Antimeridian #61

gecoombs opened this issue May 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gecoombs
Copy link
Member

If I run plot_mesh on a mesh with just two cells, each one exactly touching the anti-meridian I get the below error:

(venv) gecoomb@BSL-GECOOMB-L1:~/PycharmProjects/PolarRoute$ plot_mesh test_meshes/horizontal_0lat_antimeridian_mesh.json
[15-05-24 12:00:10 :INFO    ] - plot_mesh 0.1.0
Traceback (most recent call last):
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/bin/plot_mesh", line 8, in <module>
    sys.exit(plot_mesh_cli())
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/lib/python3.8/site-packages/bas_geoplot/utils.py", line 31, in wrapper
    res = func(*args, **kwargs)
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/lib/python3.8/site-packages/bas_geoplot/cli.py", line 93, in plot_mesh_cli
    mp.Maps(mesh, 'MeshGrid', predefined='cx')
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/lib/python3.8/site-packages/bas_geoplot/interactive.py", line 538, in Maps
    dataframe_pandas = split_at_antimeridian(dataframe_pandas)
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/lib/python3.8/site-packages/bas_geoplot/utils.py", line 187, in split_at_antimeridian
    new_polygon = MultiPolygon([poly_a, poly_b])
  File "/home/gecoomb/PycharmProjects/PolarRoute/venv/lib/python3.8/site-packages/shapely-2.0.1-py3.8-linux-x86_64.egg/shapely/geometry/multipolygon.py", line 79, in __new__
    shell = ob[0]
TypeError: 'MultiLineString' object is not subscriptable

Mesh file attached:
horizontal_0lat_antimeridian_mesh.json

@gecoombs gecoombs added the bug Something isn't working label May 15, 2024
@hjabbot
Copy link
Collaborator

hjabbot commented May 15, 2024

This is fixed with MeshiPhi 2.0.9, now there is a new issue where the routes don't plot properly over the antimeridian when there are only 2 cellboxes, meeting on the antimeridian

@gecoombs
Copy link
Member Author

gecoombs commented May 15, 2024

Example of current behaviour after MeshiPhi changes in antarctica/MeshiPhi#68:

Screenshot from 2024-05-15 16-02-33
Screenshot from 2024-05-15 16-03-47

Route json file:
horizontal_0lat_antimeridian.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants