Good morning, I am currently trying to use SphericalPolygon for checking the correct definition of an oceal model stretched grid.
I'm checking if the polygon is not selfcrossing (there is not the equivalent of the is_simple method from shapely, but I can cope checking the orientation of the triangles defined by three consecutive vertices), if all the polygons have the same orientation and, last but not least, if the provided coordinates of the grid cell centers fall in their respective cells. I am using the contains_points method, yet it fails if
- the cell boundaries are aligned with the lon lat coordinates as for (notice that the coordinates are reverted before passing them to SphericalPolygon
cells_coord.append([(200,20), (240,20), (240,40), (200,40)])
centres_coord.append((220,30))
- the cell encompasses the North Pole as in
cells_coord.append([(120,87), (160,80), (200,80), (240,87)])
centres_coord.append((140,89))
I join my work in progress file hoping for some clarifications. Thank you very much.
simple_polygons.tar.gz
Good morning, I am currently trying to use SphericalPolygon for checking the correct definition of an oceal model stretched grid.
I'm checking if the polygon is not selfcrossing (there is not the equivalent of the
is_simplemethod from shapely, but I can cope checking the orientation of the triangles defined by three consecutive vertices), if all the polygons have the same orientation and, last but not least, if the provided coordinates of the grid cell centers fall in their respective cells. I am using thecontains_pointsmethod, yet it fails ifI join my work in progress file hoping for some clarifications. Thank you very much.
simple_polygons.tar.gz