class Polygon
Encapsulates a polygon consisting of a set of linear-rings in the xy-plane. It corresponds to the org.apache.cassandra.db.marshal.PolygonType
column type in DSE.
A linear-ring is a Dse\LineString
whose last point is the same as its first point. The first ring specified in a polygon defines the outer edges of the polygon and is called the exterior ring. A polygon may also have holes within it, specified by other linear-rings, and those holes may contain linear-rings indicating islands. All such rings are called interior rings.
Extends
Methods
__construct
(array
$rings )
To construct an empty Dse\Polygon
:
$polygon = new Dse\Polygon();
To construct a Dse\Polygon
with Dse\LineString
objects:
$exterior_ring = new Dse\LineString(new Dse\Point(0, 0), new Dse\Point(10, 0), new Dse\Point(10, 10), new Dse\Point(0, 0));
$interior_ring = new Dse\LineString(new Dse\Point(1, 1), new Dse\Point(1, 5), new Dse\Point(5, 1), new Dse\Point(1, 1));
$polygon = new Dse\Polygon.new($exterior_ring, $interior_ring);
Type\Custom
type
( )The type of represented by the value.
Dse\LineString
exteriorRing
( )array
rings
( )array
interiorRings
( )string
wkt
( )string