Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
perimeter

Calculates the perimeter of a geometry.

Description

The function perimeter returns the perimeter of a geometry, using the default distance-calculation-strategy

Synopsis

template<typename Geometry>
default_length_result<Geometry>::type perimeter(Geometry const & geometry)

Parameters

Type

Concept

Name

Description

Geometry const &

Any type fulfilling a Geometry Concept

geometry

A model of the specified concept

Returns

The calculated perimeter

Header

Either

#include <boost/geometry.hpp>

Or

#include <boost/geometry/algorithms/perimeter.hpp>

Conformance

The function perimeter is not defined by OGC.

[Note] Note

PostGIS contains an algorithm with the same name and the same functionality. See the PostGIS documentation.

Behavior

Case

Behavior

pointlike (e.g. point)

Returns zero

linear (e.g. linestring)

Returns zero

areal (e.g. polygon)

Returns the perimeter

Complexity

Linear


PrevUpHomeNext