Skip to content

Some problems with the contains_points method #4

Description

@andreapiacentini

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

  1. 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))
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions