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

coordinate_system

Metafunction defining type as the coordinate system (cartesian, spherical, etc) of the point type making up the specified geometry type.

Synopsis

template<typename Geometry>
struct coordinate_system
{
  // ...
};

Template parameter(s)

Parameter

Description

typename Geometry

Any type fulfilling a Geometry Concept

Header

Either

#include <boost/geometry.hpp>

Or

#include <boost/geometry/core/coordinate_system.hpp>

Complexity

Compile time

Example

Examine the coordinate system of a point

#include <iostream>
#include <typeinfo>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/point_xy.hpp>

int main()
{
    typedef boost::geometry::model::d2::point_xy<double> point_type;
    typedef boost::geometry::model::polygon<point_type> polygon_type;

    typedef boost::geometry::coordinate_system<polygon_type>::type system;

    std::cout << "system: " << typeid(system).name() << std::endl;

    return 0;
}

Output (using MSVC):

system: struct boost::geometry::cs::cartesian

PrevUpHomeNext