Skip to main content

Module shapes

Module shapes 

Source
Expand description

§Shape generators – create geographic geometries from parameters

Generate common geometric shapes as GeoCoord rings suitable for use with the tessellator, vector layers, or direct rendering:

  • circle – regular polygon approximating a circle
  • arc – partial circle (sector boundary)
  • ellipse – elliptical ring
  • rectangle – axis-aligned geographic rectangle
  • regular_polygon – equilateral N-gon
  • sector – pie-slice shape (arc closed to centre)
  • line_along – sample points along a great-circle path

All generators produce Vec<GeoCoord> suitable for constructing Polygon exteriors or LineString coordinates.

Distance calculations use the geodesic destination formula on the WGS-84 sphere (radius 6,378,137 m).

Functions§

arc
Generate an arc (partial circle) as a polyline.
circle
Generate a circle as a closed polygon ring.
ellipse
Generate an ellipse as a closed polygon ring.
line_along
Sample count evenly-spaced points along the great-circle path between from and to.
rectangle
Generate an axis-aligned geographic rectangle as a closed polygon ring.
regular_polygon
Generate a regular N-gon as a closed polygon ring.
sector
Generate a sector (pie slice) as a closed polygon ring.