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.

See Also:

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);
Parameters:
Name Type Details
$rings array

varargs-style array of LineStrings

Type\Custom

type

( )

The type of represented by the value.

Returns:
Type Details
Type\Custom

the custom type for Dse\Polygon

Dse\LineString

exteriorRing

( )
Returns:
Type Details
Dse\LineString

the linear-ring characterizing the exterior of this Dse\Polygon. null for empty polygon.

array

rings

( )
Returns:
Type Details
array

LineStrings that constitute this Dse\Polygon

array

interiorRings

( )
Returns:
Type Details
array

LineStrings that constitute the interior rings of this Dse\Polygon

Dse\LineString

ring

( int $index )
Parameters:
Name Type Details
$index int

index of the desired Dse\LineString in this Dse\Polygon

Returns:
Type Details
Dse\LineString

the index’th Dse\LineString in this Dse\Polygon; null if there is no such element

string

wkt

( )
Returns:
Type Details
string

the well-known-text representation of this Dse\Polygon

string

__toString

( )
Returns:
Type Details
string

a human-readable string representation of this Dse\Polygon