Skip to main content

spatial_narrative/
lib.rs

1//! # spatial-narrative
2//!
3//! A Rust library for representing, analyzing, and working with narratives
4//! that unfold across real-world geographic space.
5//!
6//! ## Overview
7//!
8//! `spatial-narrative` provides tools for:
9//! - Representing events with geographic coordinates and timestamps
10//! - Organizing events into coherent narratives
11//! - Efficient spatial and temporal indexing
12//! - Graph-based analysis of event relationships
13//! - Clustering and pattern detection
14//! - Import/export in standard formats (GeoJSON, CSV, GPX)
15//!
16//! ## Quick Start
17//!
18//! ```rust,no_run
19//! use spatial_narrative::prelude::*;
20//!
21//! // Create a location
22//! let location = Location::new(40.7128, -74.0060);
23//!
24//! // Create an event
25//! let event = Event::builder()
26//!     .location(location)
27//!     .timestamp(Timestamp::now())
28//!     .text("Something happened here")
29//!     .tag("example")
30//!     .build();
31//!
32//! // Create a narrative
33//! let narrative = Narrative::builder()
34//!     .title("My Narrative")
35//!     .event(event)
36//!     .build();
37//! ```
38//!
39//! ## Modules
40//!
41//! - [`core`] - Fundamental types: `Location`, `Timestamp`, `Event`, `Narrative`
42//! - [`index`] - Spatial and temporal indexing for efficient queries
43//! - [`graph`] - Graph representation of narratives
44//! - [`analysis`] - Metrics, clustering, and movement analysis
45//! - [`io`] - Import/export in various formats
46//! - [`transform`] - Coordinate transformations and projections
47//! - [`parser`] - Extract locations from unstructured text
48//! - [`text`] - Natural language processing utilities
49
50pub mod analysis;
51pub mod core;
52pub mod graph;
53pub mod index;
54pub mod io;
55pub mod parser;
56pub mod text;
57pub mod transform;
58
59/// Error types for the library
60pub mod error;
61
62/// Prelude module for convenient imports
63pub mod prelude {
64    pub use crate::core::{
65        Event, EventBuilder, EventId, GeoBounds, Location, LocationBuilder, Narrative,
66        NarrativeBuilder, NarrativeId, NarrativeMetadata, SourceRef, SourceType, SpatialEntity,
67        TemporalEntity, TemporalPrecision, TimeRange, Timestamp,
68    };
69    pub use crate::error::{Error, Result};
70}
71
72pub use error::{Error, Result};