CARLA
Loading...
Searching...
No Matches
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 = bg::model::box<Point>

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

◆ Line3

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

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

◆ LineString

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

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

◆ MultiPolygon

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

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

◆ Point

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

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

◆ Polygon

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

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

◆ Ring

using twinmodel::geom::Ring = 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.

References Centroid().

Referenced by Centroid().

◆ 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 HeadingAt(), and Hypot().

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

◆ Hypot()

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

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

References Hypot().

Referenced by twinmodel::BuildLaneGraph(), HeadingAt(), Hypot(), Interpolate(), Project(), and Substring().

◆ 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(), and Interpolate().

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

◆ Length()

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

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

References Length().

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

◆ 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.

References MakeValid().

Referenced by MakeValid(), and 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.

References NormalizeAngle().

Referenced by twinmodel::BuildLaneGraph(), NormalizeAngle(), 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 NormalizeAngle(), and OffsetLine().

Referenced by OffsetLine().

◆ 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 NormalizeAngle(), and Polygonize().

Referenced by Polygonize().

◆ 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 Hypot(), and Project().

Referenced by Project().

◆ 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(), Length(), and Substring().

Referenced by Substring().

◆ 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(), and UnaryUnion().

Referenced by UnaryUnion().