Bay-Delta SELFE Tools

polygons Module

class polygons.Polygon(points=None, name=None, attribute=None, type=None)

Bases: object

A simple container of polygon information.

Methods

attribute
box()

Provide a bounding box of this polygon. return = a numpy array that contains [x_min, x_max, y_min, y_max]

check_point_inside_polygon(pt)

Check if points are in this polygon. It is based on ray-casting algorithm.

n_vertices()
name
type
vertices
class polygons.PolygonIO

Bases: base_io.BaseIO

Polygon file I/O class

Methods

read(fname)

Read in a polygon file. fname = polygon file return = list of polygon instances