mufasa.io.inputs.geojson#

Classes#

GeoJsonInput

Loads Observations or Locations from a GeoJSON file.

Module Contents#

class mufasa.io.inputs.geojson.GeoJsonInput(path: str)#

Bases: mufasa.io.inputs.base.InputNode

Loads Observations or Locations from a GeoJSON file.

output_type is Observation if a ‘confidence’ column is present, otherwise Location. Timestamps are mapped to the timestamp field on either type. Determined at construction time by reading the first feature of the file.

Geometries are in WGS84 (GeoJSON spec) and are reprojected to the pipeline CRS automatically by the InputNode base class.

Override decode() in a subclass to produce a richer type for potential nodes that have stricter requirements. Also set _output_type on the subclass so the DAG wiring validation sees the correct type.

Parameters:

path (str)

path#
property output_type: type#

Type this node emits. Derived from _output_type.

Return type:

type

decode(feature: dict) → mufasa.location.Location#

Convert a single GeoJSON feature dict to a Location or Observation.

Returns geometry in WGS84; reprojection to pipeline CRS is handled automatically by the InputNode base class before the item reaches any processing node. Override in a subclass to produce a richer type.

Parameters:

feature (dict)

Return type:

mufasa.location.Location

items() → list[mufasa.location.Location]#

Return items from this input in temporal order.

File-based nodes return a sorted list. Streaming nodes return a blocking generator that yields as items arrive via ingest().

Return type:

list[mufasa.location.Location]

get_config() → dict#

Return all constructor arguments as a plain JSON-serializable dict.

Used by Graph.to_config() to serialise the pipeline. Every key must be a string; every value must be JSON-serializable.

Return type:

dict