Provider for a single GeoJSON FeatureCollection artifact.
One feature becomes one staged row: payload is the feature's
"properties" map, geom is its decoded geometry or nil for a feature
that carries none. normalize/2 reads the code and name out of payload
using the manifest's options, so the same module serves any collection
whose properties name their code and display name differently.
required_options/0 requires "area_type" and "code_property". The
remaining options keys are optional:
"name_property"-- defaults to"name"."authority"-- defaults to the manifest's own authority, when it declares exactly one."attribute_properties"-- a list; defaults to[]."alias_properties"-- a list; defaults to[]."code_properties"-- a list of%{"type" => ..., "property" => ...}; defaults to[].
See the option-vocabulary table in GeoGenius.Provider's moduledoc for how
these correspond to GeoGenius.Providers.CSV's own option keys.
Summary
Functions
Every artifact declared across the manifest's sources; a GeoJSON collection's artifacts are all GeoJSON.
Asserts an edge from each area the row implies to the row's own area.
Reads the code and name out of the staged row's payload, using the manifest's options.
GeoJSON areas carry no hierarchy of their own; relations are always rebuilt.
Requires area_type and code_property in the manifest's options.
Reads path as a GeoJSON FeatureCollection and emits its features in
chunks of 1000 rows.
Validates the manifest's implied_areas entries, whose code key is code_property.
Functions
@spec artifacts(GeoGenius.Manifest.t()) :: [GeoGenius.Manifest.Artifact.t()]
Every artifact declared across the manifest's sources; a GeoJSON collection's artifacts are all GeoJSON.
@spec asserted_relations(GeoGenius.Manifest.t(), GeoGenius.Staging.Row.t()) :: [ {String.t(), String.t(), String.t()} ]
Asserts an edge from each area the row implies to the row's own area.
@spec normalize(GeoGenius.Manifest.t(), GeoGenius.Staging.Row.t()) :: {:ok, GeoGenius.Provider.Area.t()} | {:ok, [GeoGenius.Provider.Area.t()]} | :skip | {:error, String.t()}
Reads the code and name out of the staged row's payload, using the manifest's options.
@spec relations(GeoGenius.Manifest.t()) :: :rebuild
GeoJSON areas carry no hierarchy of their own; relations are always rebuilt.
@spec required_options() :: [String.t()]
Requires area_type and code_property in the manifest's options.
@spec stage( GeoGenius.Manifest.t(), GeoGenius.Manifest.Artifact.t(), Path.t(), ([GeoGenius.Staging.Row.t()] -> :ok), GeoGenius.Provider.stage_opts() ) :: :ok | {:error, GeoGenius.Provider.reason()}
Reads path as a GeoJSON FeatureCollection and emits its features in
chunks of 1000 rows.
Validates the manifest's implied_areas entries, whose code key is code_property.