NAME

Geo::Surface - A surface description.

INHERITANCE

Geo::Surface
  is a Geo::Shape

SYNOPSIS

my $island1 = Geo::Line->filled(...);
my $island2 = Geo::Surface->new(...);
my $islands = Geo::Surface->new($island1, $island2)

DESCRIPTION

In this context, a "surface" is defined as a set of filled areas with possible enclosures in one projection system. One set of islands can be kept as one surface, or the shapefile data of a country.

METHODS

Constructors

Geo::Surface->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

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

$obj->nrComponents

    Returns the number of components.

$obj->proj

Projections

$obj->in(LABEL|'utm')

$obj->projectOn(NICK, POINTS)

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

$obj->bboxRing([XMIN, YMIN, XMAX, YMAX, [PROJ]])

Geo::Surface->bboxRing([XMIN, YMIN, XMAX, YMAX, [PROJ]])

$obj->distance(OBJECT, [UNIT])

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

Display

$obj->deg2dm(DEGREES, POS, NEG)

Geo::Surface->deg2dm(DEGREES, POS, NEG)

$obj->deg2dms(DEGREES, POS, NEG)

Geo::Surface->deg2dms(DEGREES, POS, NEG)

$obj->dms2deg(DMS)

Geo::Surface->dms2deg(DMS)

$obj->toString([PROJECTION])

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

DIAGNOSTICS

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: distance calculation not implemented between a $kind and a $kind

    Only a subset of all objects can be used in the distance calculation. The limitation is purely caused by lack of time to implement this.

Error: in() not implemented for a $class

Error: not known what to do with $component

SEE ALSO

This module is part of Geo-Point distribution version 0.07, built on February 12, 2008. Website: http://perl.overmeer.net/geo/

LICENSE

Copyrights 2005-2008 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html