xoa.core.poly#
Spherical polygon geometry primitives
Provides spherical area, orientation, Sutherland-Hodgman clipping and overlap area. All functions operate on plain numpy arrays (lon/lat in degrees).
Functions
|
Convert polygons to a list of (lon, lat) arrays of shape (n, 2) |
|
Clip subject_polygon against clipping_polygon using Sutherland-Hodgman algorithm. |
|
Clip a polygon against a single edge using Sutherland-Hodgman algorithm. |
|
Compute intersection point between two line segments. |
|
Compute overlap area between two spherical polygon cells that are defined by their bounds |
|
Check if point q is on the inside of the edge defined by p1->p2. |
|
Test if a point is inside a polygon, with the ray casting algorithm |
|
Test if points are inside a polygon |
|
Quick bounding box check to eliminate obviously non-overlapping cells. |
|
Calculate a polygon area in spherical coordinates |
|
Make the longitudes of a polygon continuous, in the 180° range around a reference |