pyinterp.core.geodetic.Polygon#

class pyinterp.core.geodetic.Polygon(self, outer: list, inners: Optional[list] = None)#

Bases: pybind11_builtins.pybind11_object

The polygon contains an outer ring and zero or more inner rings.

Parameters
  • outer – outer ring.

  • inners – list of inner rings.

Raises
  • ValueError – if outer is not a list of pyinterp.geodetic.Point.

  • ValueError – if inners is not a list of list of pyinterp.geodetic.Point.

Attributes

inners

The inner rings.

outer

The outer ring.

Public Methods

area(self[, wgs])

Calculates the area.

covered_by(*args, **kwargs)

Overloaded function.

distance(*args, **kwargs)

Overloaded function.

envelope(self)

Calculates the envelope of this polygon.

from_geojson(array)

Creates a polygon from a GeoJSON coordinates array.

intersection(self, other)

Computes the intersection of this polygon with another.

intersects(self, other)

Checks if this polygon intersects another.

num_interior_rings(self)

Returns the number of the interior rings.

read_wkt(wkt)

Parses OGC Well-Known Text (WKT) into a polygon.

to_geojson(self)

Return the polygon as a GeoJSON type.

touches(self, other)

Checks if this polygon touches another.

union(self, other)

Computes the union of this polygon with another.

wkt(self)

Gets the OGC Well-Known Text (WKT) representation of this instance.

Special Methods

__copy__(self)

Implements the shallow copy operation.

__eq__(self, other)

Overrides the default behavior of the == operator.

__getstate__(self)

__ne__(self, other)

Overrides the default behavior of the != operator.

__repr__(self)

Called by the repr() built-in function to compute the string representation of a point.

__setstate__(self, arg0)