template<typename Geometry>
class boost::geometry::concepts::Linestring< Geometry >
Linestring concept.
- Formal definition:
- The linestring concept is defined as following:
- there must be a specialization of traits::tag defining linestring_tag as type
- it must behave like a Boost.Range
- it must implement a std::back_insert_iterator
- either by implementing push_back
- or by specializing std::back_insert_iterator
- Note
- to fulfill the concepts, no traits class has to be specialized to define the point type.
- Example:
A custom linestring, defining the necessary specializations to fulfill to the concept.
Suppose that the following linestring is defined:
struct custom_linestring1 : std::deque<P>
{
int id;
};
It can then be adapted to the concept as following:
namespace boost { namespace geometry { namespace traits
{
template <typename P>
struct tag< custom_linestring1<P> > { typedef linestring_tag type; };
}}}
- Note
- There is also the registration macro BOOST_GEOMETRY_REGISTER_LINESTRING
- For registration of std::vector<P> (and deque, and list) it is enough to include the header-file geometries/adapted/std_as_linestring.hpp. That registers a vector as a linestring (so it cannot be registered as a linear ring then, in the same source code).