NebulaGraphEx.Types.Geography (nebula_graph_ex v0.1.10)

Copy Markdown View Source

NebulaGraph geography (geospatial) value.

Fields

  • :kind:point, :linestring, or :polygon
  • :coords — coordinate data whose shape depends on :kind:
    • :point%{x: float(), y: float()}
    • :linestring[%{x: float(), y: float()}]
    • :polygon[[%{x: float(), y: float()}]] (list of rings)

Example

%NebulaGraphEx.Types.Geography{kind: :point, coords: %{x: 120.12, y: 30.16}}

Summary

Functions

Returns true if this geography is a point.

Returns {longitude, latitude} for a point geography, or nil.

Types

coord()

@type coord() :: %{x: float(), y: float()}

t()

@type t() :: %NebulaGraphEx.Types.Geography{
  coords: coord() | [coord()] | [[coord()]],
  kind: :point | :linestring | :polygon
}

Functions

point?(arg1)

@spec point?(t()) :: boolean()

Returns true if this geography is a point.

to_lonlat(arg1)

@spec to_lonlat(t()) :: {float(), float()} | nil

Returns {longitude, latitude} for a point geography, or nil.