API Reference geo_genius v#0.2.0

Copy Markdown View Source

Modules

A versioned catalog of named geographic areas for Elixir and PostgreSQL/PostGIS applications.

Starts GeoGenius's own supervision tree: an execution-guardian supervisor and, unless a host supplies one, a Task.Supervisor registered as GeoGenius.TaskSupervisor.

One area returned by a catalog read, with whatever the read measured about it.

Raised when a release's artifacts cannot be listed, or one of them cannot be resolved to a file on this machine.

Optional supervised child that idempotently enqueues a configured desired release at host boot.

Where downloaded and operator-supplied artifacts live between runs.

The shipped GeoGenius.Cache: artifacts stored as plain files under one root directory.

A structured refusal from the exact import-candidate lifecycle.

Writes and publishes the catalog: collections, authorities, area types, areas, their names and codes, releases, sources, artifacts, and import runs.

Raised when a GeoGenius.Catalog call cannot be completed.

Behaviour for invoking an external executable.

Runs external executables via System.cmd/3.

Runtime dependencies for one GeoGenius operation.

Behaviour for fetching a remote artifact to a local path.

Streams an artifact to disk with Req, hashing as it goes.

A structured failure to confirm an import runner enqueue.

Filesystem helpers shared by manifest loading and the providers that read staged artifacts from disk.

Raised when an import run cannot continue.

One import run, as the import_run_status view reports it.

The reviewed document that describes one release: <manifest_dir>/<collection>/<release>.json.

One file (or archive) a source is built from.

One data source within a release: where it comes from, how it is licensed, and the artifacts that carry it.

Raised when a manifest cannot be read, decoded, or validated.

Versioned GeoGenius schema migrations for host applications.

Initial prefix-safe GeoGenius catalog schema.

Repaired display geometry on both boundary writes.

Behaviour for delivering import lifecycle events to a host application.

The shipped notifier for a host that has not configured one of its own.

Turns a claimed import run into a verified release.

The import phases that obtain a release's files: download/1 and validate/1.

The GeoGenius.Command the import pipeline hands a provider: the configured command adapter, narrowed to the one executable a shipped provider needs.

The import phase that turns staged rows into catalog rows.

The import phase that rebuilds measured relations and writes every edge a provider asserts.

One run's working set, threaded through every phase.

A Postgrex types module registering the PostGIS extension, for hosts that do not already define one.

Verifies GeoGenius's database prerequisites and fails host startup when they are not met.

Raised when the database does not satisfy GeoGenius's prerequisites at startup.

Behaviour a format adapter implements to bring one kind of source into the catalog.

The whole vocabulary a provider has for describing one area.

One external code a GeoGenius.Provider.Area carries, such as a FIPS or GNIS identifier.

Turns a list of raw items into staged rows, one fun call per item, stopping at the first error.

Provider for a single delimited-text artifact with a header row.

NimbleCSV parser for a pipe-delimited artifact, defined once at compile time.

NimbleCSV parser for a semicolon-delimited artifact, defined once at compile time.

NimbleCSV parser for a tab-delimited artifact, defined once at compile time.

Streams a delimited artifact in chunks, reading its first line as the header row and handing each data line to the provider's own row builder.

Coerces a raw payload value -- read out of a GeoJSON feature's properties or a CSV row's cells -- into either a present string or nil.

Provider for a single GeoJSON FeatureCollection artifact.

Decodes the optional "geometry" member shared by GeoJSON Feature readers.

Streams newline- or RFC 8142 record-separator-delimited GeoJSON Features.

Areas a source row implies through columns other than its own code.

Manifest options lookups and payload-field extraction shared by every provider that reads a code, names, attributes, and external codes out of a manifest and a staged payload the way GeoGenius.Providers.GeoJSON and GeoGenius.Providers.CSV both do.

Provider for a shapefile archive.

The SimpleMaps US cities and ZIP codes datasets.

The state a county FIPS code is assigned within.

Turns one staged SimpleMaps row into the areas it describes.

Row-scoped consistency checks for SimpleMaps' denormalised county columns.

Composable Ecto queries over the catalog's read views.

One area of a release, as published_areas and its release-scoped base release_areas project it.

One external code held by an area of a release, as published_area_codes and its release-scoped base release_area_codes project it.

One name held by an area of a release, as published_area_names and its release-scoped base release_area_names project it.

One parent-to-child edge among areas of a release, as published_area_relations and its release-scoped base release_relations project it.

Composable Ecto queries over the catalog's read functions.

Raised when a reading call through GeoGenius.Store cannot be completed.

Translates the catalog's exact-candidate lifecycle decision into the public Elixir result vocabulary.

What files a release was built from, and where each one is on this machine.

One artifact a release composes, together with where it resolves to on this machine.

Maps a Postgrex.Result into structs by column name.

Behaviour for backends that start a claimed import run.

Runs an import in the calling process.

Runs an import as a durable PgFlow background job.

Runs an import under a Task.Supervisor.

One area returned by a plural catalog read, paired with the seed that found it.

The per-run landing area between an artifact and the catalog.

One staged record.

Raised when a staging table cannot be written to or read from.

The contract every catalog read goes through.

Every read is one call to a SQL function in the installed schema, with every optional argument bound explicitly, so a read never inherits a default from the database that differs from the one the library documents.

Telemetry events GeoGenius emits.

Mix Tasks

Checks that the installed GeoGenius schema version matches the version shipped by this package.

Generates a pinned wrapper for one supported adjacent GeoGenius schema upgrade.

Registers a collection release from its manifest and enqueues its import.

Renders a pinned GeoGenius SQL transition for non-Ecto migration hosts.

Publishes a verified release, so reads that name no release id resolve to it.

Rolls a collection's publication back to its previous release.

Generates the host application's pinned initial GeoGenius migration wrapper.

Reports import runs, and what a collection currently publishes.

Drops per-run staging tables left behind by runs that have already finished.

Drops the GeoGenius schema and all of its data at a prefix.