METHODS

Constructors

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

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

COMPONENTS are Math::Polygon, Math::Polygon::Surface, Geo::Line, Geo::Surface objects. When an ARRAY is specfied as COMPONENT, it will be used to instantiate a Math::Polygon::Surface object. In case of a Geo::Surface, the included polygons are translated to the specified projection.

Option Defined in Default

proj

Geo::Shape

<see Geo::Proj::defaultProjection()

proj => LABEL
» Warning: Geo::Line is should be filled

When Geo::Line objects are used to compose a surface, each of them must be filled. Representation of rivers and such do not belong in a surface description.

» Error: not known what to do with $component

Attributes

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

Returns the component (or components) with the specified INDEX(es). One Math::Polygon::Surface in scalar context, and multiple in list context.

$obj->components

Returns a list of Math::Polygon::Surface objects, together forming the surface.

$obj->nrComponents

Returns the number of 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

The bounding box of the combined polygons.

$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 surfaces are equal is a lot of work. Therefore, only exactly equal surface descriptions are considered equivalent.

$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.