mgrs2latlong

Crates.iomgrs2latlong
lib.rsmgrs2latlong
version0.1.0
created_at2025-08-27 12:51:22.985011+00
updated_at2025-08-27 12:51:22.985011+00
descriptionA command-line tool for converting MGRS coordinates to latitude/longitude in CSV files
homepage
repositoryhttps://github.com/4n6h4x0r/mgrs2latlong
max_upload_size
id1812531
size19,992
Albert Hui (h4x0r)

documentation

README

MGRS to Lat/Long Converter

A Rust command-line tool for converting MGRS (Military Grid Reference System) coordinates to latitude/longitude in CSV files.

Author

Albert Hui albert@securityronin.com

Features

  • Automatically detects MGRS coordinate columns in CSV files
  • Converts MGRS coordinates to decimal latitude/longitude
  • Preserves original data while adding new latitude and longitude columns
  • Supports flexible MGRS format recognition
  • Command-line interface with input/output file options

Installation

Ensure you have Rust installed, then build the project:

cargo build --release

Usage

# Convert MGRS coordinates in input.csv and write to output.csv
./target/release/mgrs2latlong input.csv --output output.csv

# Convert and output to stdout
./target/release/mgrs2latlong input.csv

Input Format

The tool accepts CSV files with MGRS coordinates in any column. MGRS coordinates should follow the standard format (e.g., "33TWM1234567890" or "33T WM 12345 67890").

Output Format

The tool outputs a CSV file with:

  • All original columns preserved
  • Additional latitude column with decimal degrees
  • Additional longitude column with decimal degrees

Dependencies

  • clap - Command-line argument parsing
  • csv - CSV file handling
  • regex - Pattern matching for MGRS detection
  • geoconvert - MGRS coordinate conversion
  • anyhow - Error handling

License

This project is open source.

Commit count: 0

cargo fmt