# fastGeoToolkit
[](https://crates.io/crates/fastgeotoolkit)
[](https://docs.rs/fastgeotoolkit)
[](https://opensource.org/licenses/MIT)
A novel high-performance geospatial analysis framework with advanced route density mapping algorithms.
## Features
- **High-Performance GPS Processing**: Optimized algorithms for large-scale GPS trajectory analysis
- **Multi-Format Support**: GPX, FIT, and polyline format parsing
- **Route Density Mapping**: Novel segment-based frequency analysis for route popularity visualization
- **Coordinate Validation**: Robust filtering of unrealistic GPS jumps and invalid coordinates
- **Track Simplification**: Douglas-Peucker-inspired algorithms for efficient data reduction
- **Geospatial Analytics**: Intersection detection, clustering, and coverage analysis
- **Cross-Platform**: Native Rust with optional WebAssembly compilation
## Quick Start
Add this to your `Cargo.toml`:
```toml
[dependencies]
fastgeotoolkit = "0.1.3"
```
### Basic Usage
```rust
use fastgeotoolkit::{
process_gpx_files, decode_polyline,
calculate_track_statistics, find_track_intersections
};
// Process GPX files
let gpx_data = std::fs::read("track.gpx")?;
let result = process_gpx_files(&[gpx_data]);
// Decode polylines
Enable WebAssembly compilation:
```toml
[dependencies]
fastgeotoolkit = { version = "0.1.3", features = ["wasm"] }
```
## API Documentation
### Core Functions
- `process_gpx_files()` - Parse and analyze GPX file data
- `decode_polyline()` - Decode Google polyline format
- `process_polylines()` - Batch process polyline data
- `validate_coordinates()` - Validate GPS coordinate arrays
- `simplify_track()` - Reduce track point density while preserving shape
### Analysis Functions
- `calculate_track_statistics()` - Distance, bounds, and point count analysis
- `find_track_intersections()` - Detect where multiple tracks intersect
- `cluster_tracks_by_similarity()` - Group similar routes together
- `calculate_coverage_area()` - Compute geographic coverage of track data
### Conversion Functions
- `coordinates_to_geojson()` - Export to GeoJSON format
- `export_to_gpx()` - Generate GPX files from coordinate data
- `coordinates_to_polyline()` - Encode coordinates as polylines
## Performance
fastGeoToolkit is optimized for processing large GPS datasets:
- **Memory Efficient**: Streaming processing for large files
- **Fast Parsing**: Optimized GPX and FIT file readers
- **Parallel Processing**: Multi-threaded analysis where applicable
- **WASM Ready**: Near-native performance in web browsers
## Algorithm Details
### Route Density Mapping
Our novel approach uses segment-based frequency analysis:
1. **Segmentation**: Tracks are broken into coordinate pairs
2. **Grid Snapping**: Coordinates are snapped to a tolerance grid
3. **Frequency Counting**: Overlapping segments are identified and counted
4. **Normalization**: Track frequencies are calculated from segment usage
This approach provides more accurate route popularity visualization compared to simple point-based methods.
## Examples
See the `examples/` directory for comprehensive usage examples:
- `basic_usage.rs` - Getting started with core functions
- `route_density.rs` - Advanced heatmap generation
- `batch_processing.rs` - Processing multiple files efficiently
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
## Citation
If you use fastGeoToolkit in academic research, please cite:
```bibtex
@software{fastgeotoolkit2024,
title={fastGeoToolkit: A Novel High-Performance Geospatial Analysis Framework with Advanced Route Density Mapping},
author={fastGeoToolkit Contributors},
year={2024},
url={https://github.com/a0a7/fastgeotoolkit},
version={0.1.3}
}
```