The contract every catalog read goes through.
A store issues one call to a shipped SQL function per read and maps the rows. It adds no filtering, ordering, or limiting of its own: those belong to the SQL API, where they are already specified and tested.
Summary
Types
A coordinate or a radius in metres.
The plural reads' seeds: many area keys, or many code values.
Functions
The store this host configured, or the shipped default.
Resolves a backend name to its module.
Types
A coordinate or a radius in metres.
These bind as double precision, and a host holds one in whatever shape it
read: a float, an integer for a whole-degree coordinate, or the %Decimal{}
Ecto loads from a numeric column. All three are accepted.
@type seeds() :: [String.t()]
The plural reads' seeds: many area keys, or many code values.
Each returned GeoGenius.SeededMatch carries the seed it came from, and a
seed that matched nothing contributes no row.
Callbacks
@callback ancestors_of(GeoGenius.Context.t(), String.t(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback ancestors_of_many(GeoGenius.Context.t(), seeds(), keyword()) :: [ GeoGenius.SeededMatch.t() ]
@callback areas_by_code(GeoGenius.Context.t(), String.t(), String.t(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback areas_by_code_many(GeoGenius.Context.t(), String.t(), seeds(), keyword()) :: [ GeoGenius.SeededMatch.t() ]
@callback areas_for_geometry(GeoGenius.Context.t(), Geo.geometry(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback areas_for_point(GeoGenius.Context.t(), numeric(), numeric(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback areas_near(GeoGenius.Context.t(), numeric(), numeric(), numeric(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback children_of(GeoGenius.Context.t(), String.t(), keyword()) :: [ GeoGenius.AreaMatch.t() ]
@callback children_of_many(GeoGenius.Context.t(), seeds(), keyword()) :: [ GeoGenius.SeededMatch.t() ]
@callback release_at(GeoGenius.Context.t(), DateTime.t(), keyword()) :: Ecto.UUID.t() | nil
@callback resolve(GeoGenius.Context.t(), map(), keyword()) :: [GeoGenius.AreaMatch.t()]
@callback search_areas(GeoGenius.Context.t(), String.t(), keyword()) :: [ GeoGenius.AreaMatch.t() ]