1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # Install
//!
//! The recommended way to build and use EORST is via [Nix](https://nixos.org/download.html).
//! Nix ensures reproducible builds with all dependencies (including GDAL, OpenCV, LightGBM) pre-configured.
//!
//! ## Prerequisites
//!
//! Install Nix with flake support:
//!
//! ```bash
//! # Install Nix
//! sh <(curl -L https://nixos.org/nix/install) --daemon
//!
//! # Enable flakes (add to ~/.config/nix/nix.conf or ~/.nix-profile/etc/nix/nix.conf)
//! experimental-features = nix-command flakes
//! ```
//!
//! ## Quick Start
//!
//! ### Run CLI tools
//!
//! ```bash
//! # Run eo-rasterize
//! nix run .#run.eorst
//!
//! # Or with options
//! nix run .#run.eorst -- --help
//! ```
//!
//! ### Development Shell
//!
//! ```bash
//! # Enter development environment with all dependencies
//! nix develop
//!
//! # Then run examples or tests
//! cargo run --example 3_process_image
//! cargo test
//! ```
//!
//! ### Build from Source
//!
//! ```bash
//! # Build the library
//! nix build .#build.eorst
//!
//! # Build CLI tools
//! nix build .#build.eo-rasterize
//! ```
//!
//! ## Available Commands
//!
//! | Command | Description |
//! |---------|-------------|
//! | `nix run .#run.eorst` | Run the eorst CLI tool |
//! | `nix run .#run.eo-rasterize` | Run the eo-rasterize CLI tool |
//! | `nix build .#build.eorst` | Build the library |
//! | `nix build .#test.eorst` | Run tests |
//! | `nix build .#clippy.eorst` | Run clippy lints |
//! | `nix build .#container.eorst` | Build Docker container |
//! | `nix develop` | Enter development shell |
//!
//! ## Troubleshooting
//!
//! If using behind a proxy, pass `--impure` to preserve environment variables:
//!
//! ```bash
//! nix run --impure .#run.eorst
//! ```
//!
//! ## Manual Build (Not Recommended)
//!
//! If you prefer to build manually, you'll need:
//! - [Rust](https://rustup.rs/) (latest stable)
//! - [GDAL](https://gdal.org/) 3.x
//! - OpenCV (optional, for computer vision features)
//! - LightGBM (optional, for machine learning features)
//!
//! ```bash
//! cargo build --workspace --all-features
//! ```
//!
//! Note: Manual setup is error-prone due to numerous system dependencies. Nix handles this automatically.