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. Some set of islands can be kept as one surface. Or the data of a country: mainland, islands and lakes. Or multiple tiles of one image.

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, and 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.

    If no projection is specified, then the projection of the first component will be used to project all components to.

    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

$obj->proj4

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.10, built on January 21, 2009. Website: http://perl.overmeer.net/geo/ All modules in this suite: "Geo::Point", "Geo::Proj4", "Geo::WKT", "Math::Polygon", "Geo::GML", "Geo::ISO19139", "Geo::EOP", and "Geo::Format::Envisat".

Please post questions or ideas to http://geo-perl@list.hut.fi|the mailinglist

LICENSE

Copyrights 2005-2009 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