GeoGenius.Provider.Area (geo_genius v0.2.0)

Copy Markdown View Source

The whole vocabulary a provider has for describing one area.

centroid is a %Geo.Point{} or nil. When it is nil and geometry is present, the pipeline leaves it nil rather than asking PostGIS to derive one, because put_area_in_release/5 accepts a null centroid.

Summary

Types

Free-form, provider-specific attributes carried onto the area as-is.

t()

Functions

The catalog key for an area: authority_key, area_type_key and code joined by :.

Types

attributes()

@type attributes() :: %{optional(String.t()) => term()}

Free-form, provider-specific attributes carried onto the area as-is.

t()

@type t() :: %GeoGenius.Provider.Area{
  area_type_key: String.t(),
  attributes: attributes(),
  authority_key: String.t(),
  centroid: Geo.Point.t() | nil,
  code: String.t(),
  codes: [GeoGenius.Provider.Area.Code.t()],
  geometry: Geo.geometry() | nil,
  names: [GeoGenius.Provider.Area.Name.t()]
}

Functions

key(area)

@spec key(t()) :: String.t()

The catalog key for an area: authority_key, area_type_key and code joined by :.

This is the same composition PostgreSQL stores in area.area_key, which is what makes the key a provider composes here addressable by every read. GeoGenius.Provider.asserted_relations/2 returns those keys as strings, so this is how a provider names the two ends of an edge without re-deriving the format. An area keyed census, county, 06075 is "census:county:06075".

The agreement between this and the column is pinned by GeoGenius.PipelineTest, once, rather than per caller.