CARLA
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
twinmodel::geom Namespace Reference

Classes

struct  Point3
 

Typedefs

using Box = bg::model::box< Point >
 
using Line3 = std::vector< Point3 >
 
using LineString = bg::model::linestring< Point >
 
using MultiPolygon = bg::model::multi_polygon< Polygon >
 
using Point = bg::model::d2::point_xy< double >
 
using Polygon = bg::model::polygon< Point, true, true >
 
using Ring = bg::model::ring< Point, true, true >
 

Functions

Point Centroid (const Polygon &polygon)
 
double HeadingAt (const LineString &line, double s)
 Heading of line at distance s, in radians.
 
double Hypot (const Point &a, const Point &b)
 
Point Interpolate (const LineString &line, double s)
 Point at distance s along line, shapely's LineString.interpolate.
 
double Length (const LineString &line)
 
Polygon MakeValid (const Polygon &polygon)
 bg::is_valid plus a correction pass, shapely's make_valid.
 
double NormalizeAngle (double angle)
 Signed angle in (-pi, pi] that turns heading from into heading to.
 
LineString OffsetLine (const LineString &line, double offset)
 Offset line sideways by offset metres, positive to the left.
 
std::vector< Polygon > Polygonize (const std::vector< LineString > &edges)
 Build polygons from a set of noded edges, shapely's polygonize.
 
double Project (const LineString &line, const Point &p)
 Distance along line of the projection of p, shapely's LineString.project.
 
LineString Substring (const LineString &line, double from, double to)
 The piece of line between distances from and to, shapely's substring: endpoints are inserted so the cut is exact.
 
LineString To2D (const Line3 &line)
 
Point To2D (const Point3 &p)
 
MultiPolygon UnaryUnion (const std::vector< Polygon > &polygons)
 

Typedef Documentation

◆ Box

using twinmodel::geom::Box = typedef bg::model::box<Point>

Definition at line 31 of file osm2odr/Geometry.h.

◆ Line3

using twinmodel::geom::Line3 = typedef std::vector<Point3>

Definition at line 41 of file osm2odr/Geometry.h.

◆ LineString

using twinmodel::geom::LineString = typedef bg::model::linestring<Point>

Definition at line 27 of file osm2odr/Geometry.h.

◆ MultiPolygon

using twinmodel::geom::MultiPolygon = typedef bg::model::multi_polygon<Polygon>

Definition at line 30 of file osm2odr/Geometry.h.

◆ Point

using twinmodel::geom::Point = typedef bg::model::d2::point_xy<double>

Definition at line 26 of file osm2odr/Geometry.h.

◆ Polygon

using twinmodel::geom::Polygon = typedef bg::model::polygon<Point, true, true>

Definition at line 29 of file osm2odr/Geometry.h.

◆ Ring

using twinmodel::geom::Ring = typedef bg::model::ring<Point, true, true>

Definition at line 28 of file osm2odr/Geometry.h.

Function Documentation

◆ Centroid()

Point twinmodel::geom::Centroid ( const Polygon &  polygon)
inline

Definition at line 85 of file osm2odr/Geometry.h.

◆ HeadingAt()

double twinmodel::geom::HeadingAt ( const LineString &  line,
double  s 
)

Heading of line at distance s, in radians.

Definition at line 90 of file osm2odr/Geometry.cpp.

References Hypot().

Referenced by twinmodel::BuildLaneGraph(), and twinmodel::BuildSignals().

◆ Hypot()

double twinmodel::geom::Hypot ( const Point &  a,
const Point &  b 
)
inline

◆ Interpolate()

Point twinmodel::geom::Interpolate ( const LineString &  line,
double  s 
)

Point at distance s along line, shapely's LineString.interpolate.

Definition at line 69 of file osm2odr/Geometry.cpp.

References Hypot().

Referenced by twinmodel::BuildSignals(), and Substring().

◆ Length()

double twinmodel::geom::Length ( const LineString &  line)
inline

◆ MakeValid()

Polygon twinmodel::geom::MakeValid ( const Polygon &  polygon)

bg::is_valid plus a correction pass, shapely's make_valid.

Definition at line 178 of file osm2odr/Geometry.cpp.

Referenced by UnaryUnion().

◆ NormalizeAngle()

double twinmodel::geom::NormalizeAngle ( double  angle)
inline

Signed angle in (-pi, pi] that turns heading from into heading to.

Definition at line 96 of file osm2odr/Geometry.h.

Referenced by twinmodel::BuildLaneGraph(), OffsetLine(), and Polygonize().

◆ OffsetLine()

LineString twinmodel::geom::OffsetLine ( const LineString &  line,
double  offset 
)

Offset line sideways by offset metres, positive to the left.

Definition at line 131 of file osm2odr/Geometry.cpp.

References heading, and NormalizeAngle().

◆ Polygonize()

std::vector< Polygon > twinmodel::geom::Polygonize ( const std::vector< LineString > &  edges)

Build polygons from a set of noded edges, shapely's polygonize.

Used for junction outlines, where the input is the union of the incoming kerbs.

Definition at line 208 of file osm2odr/Geometry.cpp.

References node, nodes, and NormalizeAngle().

◆ Project()

double twinmodel::geom::Project ( const LineString &  line,
const Point &  p 
)

Distance along line of the projection of p, shapely's LineString.project.

Definition at line 40 of file osm2odr/Geometry.cpp.

References distance, and Hypot().

◆ Substring()

LineString twinmodel::geom::Substring ( const LineString &  line,
double  from,
double  to 
)

The piece of line between distances from and to, shapely's substring: endpoints are inserted so the cut is exact.

Definition at line 106 of file osm2odr/Geometry.cpp.

References Hypot(), Interpolate(), and Length().

◆ To2D() [1/2]

LineString twinmodel::geom::To2D ( const Line3 &  line)
inline

Definition at line 47 of file osm2odr/Geometry.h.

References To2D().

◆ To2D() [2/2]

Point twinmodel::geom::To2D ( const Point3 &  p)
inline

◆ UnaryUnion()

MultiPolygon twinmodel::geom::UnaryUnion ( const std::vector< Polygon > &  polygons)

Definition at line 163 of file osm2odr/Geometry.cpp.

References MakeValid().