METHODS

Constructors

$obj->new( [COMPONENTS], [OPTIONS] )
$class->new( [COMPONENTS], [OPTIONS] )

When called as instance method, some defaults are copied from the object where the call is made upon. Usually called as class method.

COMPONENTS are Math::Polygon, Math::Polygon::Surface, Geo::Point, Geo::Line, Geo::Surface, Geo::Space objects.

Option Defined in Default

proj

Geo::Shape

<see Geo::Proj::defaultProjection()

proj => LABEL

Attributes

$obj->component( INDEX, [INDEX, ...] )

Returns the component (or components) with the specified INDEX(es). One Geo::Shape object in scalar context, and multiple in list context.

$obj->components

Returns a list of Geo::Shape objects, all located in this space.

$obj->lines

Returns a list of Geo::Line objects, which are defined as separate components.

$obj->nrComponents

Returns the number of components.

$obj->onlyLines

Returns true when all components are lines; Geo::Line objects.

$obj->onlyPoints

Returns true when all components are points; Geo::Point objects.

$obj->onlyRings

Returns true when all components are closed lines; Geo::Line objects each defined as ring.

$obj->points

Returns a list of Geo::Point objects, which are defined as separate components.

$obj->proj
See proj in Geo::Shape.

Projections

$obj->in( LABEL|'utm' )
See in in Geo::Shape.
$obj->projectOn( NICK, POINTS )
See projectOn in Geo::Shape.

Geometry

$obj->area

Returns the area enclosed by the combined components. Only useful when the points are in some orthogonal projection.

$obj->bbox
See bbox in Geo::Shape.
$obj->bboxCenter
See bboxCenter in Geo::Shape.
$obj->bboxRing( [XMIN, YMIN, XMAX, YMAX, [PROJ]] )
$class->bboxRing( [XMIN, YMIN, XMAX, YMAX, [PROJ]] )
See bboxRing in Geo::Shape.
$obj->distance( OBJECT, [UNIT] )
See distance in Geo::Shape.
$obj->equal( OTHER, [TOLERANCE] )

Detailed calculation whether two spaces are equal is a lot of work. Therefore, only exactly equal spaces are considered equivalent: even the order of the components must be the same.

$obj->perimeter

The length of the outer polygons of all components. Only useful in a orthogonal coordinate systems.

$obj->sameAs( OTHER, TOLERANCE )
See sameAs in Geo::Shape.

Display

$obj->deg2dm( DEGREES, POS, NEG )
$class->deg2dm( DEGREES, POS, NEG )
See deg2dm in Geo::Shape.
$obj->deg2dms( DEGREES, POS, NEG )
$class->deg2dms( DEGREES, POS, NEG )
See deg2dms in Geo::Shape.
$obj->dms2deg( DMS )
$class->dms2deg( DMS )
See dms2deg in Geo::Shape.
$obj->toString( [PROJECTION] )

Returns a string representation of the line, which is also used for stringification.

» Example: