Shapes
GIS made easy, a lightweight header-only planar geometry library for Modern C++
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
simo::shapes::basic_linestring< T, AllocatorType > Class Template Reference
Inheritance diagram for simo::shapes::basic_linestring< T, AllocatorType >:
simo::shapes::basic_geometry< basic_linestring< T > >

Public Types

using base_type = std::vector< T, AllocatorType >
 
using point_type = typename T::point_type
 
using point_iterator = typename std::vector< T >::iterator
 
using point_const_iterator = typename std::vector< T >::const_iterator
 
using coord_type = typename T::coord_type
 
using coord_iterator = typename std::vector< coord_type >::iterator
 
using coord_const_iterator = typename std::vector< coord_type >::const_iterator
 

Public Member Functions

 basic_linestring (std::initializer_list< T > init)
 
 basic_linestring (coord_const_iterator first, coord_const_iterator last)
 
 basic_linestring (coord_iterator first, coord_iterator last)
 
 basic_linestring (point_iterator first, point_iterator last)
 
 basic_linestring (point_const_iterator first, point_const_iterator last)
 
std::vector< std::tuple< double, double > > xy () const
 DOCUMENT ME! More...
 
std::string polyline (std::int32_t precision=5) const
 DOCUMENT ME! More...
 
- Public Member Functions inherited from simo::shapes::basic_geometry< basic_linestring< T > >
geometry_type geom_type () const noexcept
 Returns the geometry type. More...
 
std::string tagged_text () const noexcept
 Returns the geometry type as a string. More...
 
dimension_type dim () const noexcept
 Returns the dimension type for the geometry. More...
 
size_t ndim () const noexcept
 Returns the number of dimensions of the geometry. More...
 
void throw_for_invalid () const
 Raise an error if the geometry is invalid. More...
 
bool is_closed () const noexcept
 Whether the geometry is closed. More...
 
bool is_valid () const noexcept
 Whether the geometry is valid. More...
 
bounds_t bounds () const
 Returns the bounding box of the geometry. More...
 
bool has_z () const noexcept
 Whether the geometry has the z-coordinate. More...
 
bool has_m () const noexcept
 Whether the geometry has the m-coordinate (measurement coordinate) More...
 
std::string json (std::int32_t precision=-1) const
 Dumps the geojson representation of the geometry. More...
 
std::string wkt (std::int32_t precision=-1) const
 Dumps the wkt representation of the geometry. More...
 

Static Public Member Functions

static basic_linestring< T > from_polyline (const std::string &polyline, std::int32_t precision=5)
 DOCUMENT ME! More...
 
- Static Public Member Functions inherited from simo::shapes::basic_geometry< basic_linestring< T > >
static basic_linestring< T > from_json (const std::string &json)
 Creates a geometry from a geojson string. More...
 
static basic_linestring< T > from_wkt (const std::string &wkt)
 Creates a Geometry from a wkt string. More...
 

Friends

class basic_geometry< basic_linestring< T > >
 
bool operator== (const basic_linestring< T > &lhs, const basic_linestring< T > &rhs)
 
bool operator!= (const basic_linestring< T > &lhs, const basic_linestring< T > &rhs)
 

Detailed Description

template<typename T, typename AllocatorType = std::allocator<T>>
class simo::shapes::basic_linestring< T, AllocatorType >

Definition at line 20 of file linestring.hpp.

Constructor & Destructor Documentation

template<typename T, typename AllocatorType = std::allocator<T>>
simo::shapes::basic_linestring< T, AllocatorType >::basic_linestring ( coord_const_iterator  first,
coord_const_iterator  last 
)
inlineexplicit
Todo:
deal with repetition

Definition at line 39 of file linestring.hpp.

template<typename T, typename AllocatorType = std::allocator<T>>
simo::shapes::basic_linestring< T, AllocatorType >::basic_linestring ( coord_iterator  first,
coord_iterator  last 
)
inlineexplicit
Todo:
deal with repetition

Definition at line 50 of file linestring.hpp.

Member Function Documentation

template<typename T, typename AllocatorType = std::allocator<T>>
static basic_linestring<T> simo::shapes::basic_linestring< T, AllocatorType >::from_polyline ( const std::string &  polyline,
std::int32_t  precision = 5 
)
inlinestatic

DOCUMENT ME!

Parameters
polyline
precision
Returns
Since
0.0.1

Definition at line 133 of file linestring.hpp.

template<typename T, typename AllocatorType = std::allocator<T>>
std::string simo::shapes::basic_linestring< T, AllocatorType >::polyline ( std::int32_t  precision = 5) const
inline

DOCUMENT ME!

Parameters
precision
Returns
Since
0.0.1

Definition at line 148 of file linestring.hpp.

template<typename T, typename AllocatorType = std::allocator<T>>
std::vector<std::tuple<double, double> > simo::shapes::basic_linestring< T, AllocatorType >::xy ( ) const
inline

DOCUMENT ME!

Returns

Definition at line 112 of file linestring.hpp.

Friends And Related Function Documentation

template<typename T, typename AllocatorType = std::allocator<T>>
bool operator!= ( const basic_linestring< T > &  lhs,
const basic_linestring< T > &  rhs 
)
friend
Parameters
lhsa linestring
rhsa linestring
Returns
true if at least one point is different, otherwise false
Since
0.0.1

Definition at line 103 of file linestring.hpp.

template<typename T, typename AllocatorType = std::allocator<T>>
bool operator== ( const basic_linestring< T > &  lhs,
const basic_linestring< T > &  rhs 
)
friend
Parameters
lhsa linestring
rhsa linestring
Returns
true if all points are equal, otherwise false
Since
0.0.1

Definition at line 80 of file linestring.hpp.


The documentation for this class was generated from the following file: