The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Geo::Surface - A surface description.

INHERITANCE

 Geo::Surface
   is a Geo::Shape

SYNOPSIS

 !!!! ALPHA code, see README !!!!
 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

    Example:

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

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->string([PROJECTION])

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

    Example:

DIAGNOSTICS

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.

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: in() not implemented for a $class

REFERENCES

See the Geo::Point website at http://perl.overmeer.net/geopoint for more details.

COPYRIGHTS

Module version 0.04. Written by Mark Overmeer (geopoint@overmeer.net). See the ChangeLog for other contributors.

Copyright (c) 2004-2006 by the author(s). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.