Geo.Turf.Transformation (geo_turf v0.3.0)

A collection of functions to transform given geometries

Summary

Functions

Create a circle polygon from a given center and radius. The circle is created by generating a number of points around the center and then connecting them to form a polygon.

Types

Link to this type

circle_options()

@type circle_options() :: [units() | steps()]
@type steps() :: {:steps, non_neg_integer()}
@type units() :: {:unit, Geo.Turf.Math.length_unit()}

Functions

Link to this function

circle(center, radius, opts \\ [])

@spec circle(
  center :: Geo.Point.t(),
  radius :: non_neg_integer(),
  opts :: circle_options()
) ::
  Geo.Polygon.t()

Create a circle polygon from a given center and radius. The circle is created by generating a number of points around the center and then connecting them to form a polygon.

Parameters

  • center - the center of the circle
  • radius - the radius of the circle
  • opts - a keyword list of options

Options

  • :units - the unit of the radius, defaults to :kilometers. see Geo.Turf.Math.length_unit/0
  • :steps - the number of steps to use to create the circle, defaults to 64
    • steps must be a positive integer or an ArgumentError will be raised
    • Note the higher the number of steps, the smoother the circle will be, but the more points it will have