src/geokit@geometry.erl

-module(geokit@geometry).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/geokit/geometry.gleam").
-export_type([geometry/0]).

-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.

?MODULEDOC(
    " Geometry types shared by [`geokit/bbox`](./bbox.html),\n"
    " [`geokit/centroid`](./centroid.html), and\n"
    " [`geokit/simplify`](./simplify.html).\n"
    "\n"
    " The ADT mirrors RFC 7946 GeoJSON (`Point`, `LineString`,\n"
    " `Polygon`, `MultiPolygon`) but only carries geometric data — no\n"
    " properties, no IDs, no coordinate-reference-system metadata —\n"
    " because every consumer in this package operates on coordinates\n"
    " alone.\n"
    "\n"
    " `LineString` and `Polygon` rings are simple lists of points; no\n"
    " invariant is enforced at the type level. Operations that require\n"
    " a particular shape (a polygon with a closed exterior ring, for\n"
    " example) document and check their preconditions explicitly.\n"
).

-type geometry() :: {point, geokit@latlng:lat_lng()} |
    {line_string, list(geokit@latlng:lat_lng())} |
    {polygon, list(list(geokit@latlng:lat_lng()))} |
    {multi_polygon, list(list(list(geokit@latlng:lat_lng())))}.