GeoMeasure.Bbox (GeoMeasure v0.0.1)

View Source

Calculates the bounding box of a Geo struct.

Examples:

iex> GeoMeasure.Bbox.bbox(%Geo.Point{coordinates: {1, 2}})
%Geo.Point{coordinates: {1, 2}}

iex> GeoMeasure.Bbox.bbox(%Geo.LineString{coordinates: [{1, 2}, {3, 4}]})
%Geo.Polygon{coordinates: [[{1, 2}, {1, 4}, {3, 4}, {3, 2}, {1, 2}]]}

iex> GeoMeasure.Bbox.bbox(%Geo.Polygon{coordinates: [[{0, 0}, {0, 2}, {2, 2}, {2, 0}, {0, 0}]]})
%Geo.Polygon{coordinates: [[{0, 0}, {0, 2}, {2, 2}, {2, 0}, {0, 0}]]}

Summary

Functions

Calculates the bounding box of a Geo struct as a Geo.Polygon.

Functions

bbox(point)

(since 0.0.1)
@spec bbox(Geo.Point.t()) :: Geo.Point.t()
@spec bbox(Geo.LineString.t()) :: Geo.Polygon.t()
@spec bbox(Geo.Polygon.t()) :: Geo.Polygon.t()

Calculates the bounding box of a Geo struct as a Geo.Polygon.