Skip to content

JHassall/DEMBuilder

Repository files navigation

DEMBuilder

Digital Elevation Model Builder for Agricultural Applications

DEMBuilder is a high-performance desktop application designed to process GPS data from agricultural operations and generate Digital Elevation Models (DEMs) optimized for precision farming and tractor guidance systems.

πŸš€ Features

Core Functionality

  • Multi-GPS Data Processing: Handle up to 6 GPS units recording simultaneously
  • Large Dataset Support: Process 600,000+ GPS points with streaming algorithms
  • Real-time Progress Tracking: Visual progress bars for all operations
  • Interactive Boundary Selection: Draw field boundaries on satellite maps
  • High-Performance Filtering: Parallel processing with HDOP, RTK, and Age filters
  • Multiple Export Formats: RgF DEM, GeoTIFF, and text file exports

Export System

  • RgF DEM Format: Single-file agricultural packages optimized for ABLS software
  • GeoTIFF Export: AgOpenGPS-compatible tiled exports with GDAL integration
  • Text Export: ASCII grid format for general use
  • Thumb Drive Optimized: Single files perfect for field transfer

Performance Features

  • Parallel Processing: Multi-core CPU utilization for filtering and boundary operations
  • Streaming Processing: Memory-efficient handling of massive datasets
  • Spatial Indexing: Optimized point-in-polygon testing with bounding box pre-filtering
  • Asynchronous Operations: Responsive UI during long-running processes

πŸ—οΈ Architecture

Application Structure

DEMBuilder/
β”œβ”€β”€ MainWindow.xaml(.cs)      # Main application window with wizard navigation
β”œβ”€β”€ Pages/                    # Wizard pages for step-by-step workflow
β”‚   β”œβ”€β”€ LoadDataPage          # GPS data import (NMEA files)
β”‚   β”œβ”€β”€ FilterDataPage        # GPS point filtering (HDOP, RTK, Age)
β”‚   β”œβ”€β”€ BoundaryPage          # Interactive boundary selection
β”‚   β”œβ”€β”€ ProjectionPage        # Coordinate system setup
β”‚   β”œβ”€β”€ DemGenerationPage     # DEM creation
β”‚   β”œβ”€β”€ DemPreviewPage        # DEM visualization
β”‚   └── ExportPage            # Export format selection and processing
β”œβ”€β”€ Services/                 # Core processing services
β”‚   β”œβ”€β”€ Boundary/             # Boundary filtering services
β”‚   β”œβ”€β”€ Dem/                  # DEM generation services
β”‚   β”œβ”€β”€ Export/               # Export format handlers
β”‚   β”œβ”€β”€ Filter/               # GPS point filtering
β”‚   β”œβ”€β”€ Projection/           # Coordinate system projection
β”‚   └── Streaming/            # Large dataset processing
β”œβ”€β”€ Models/                   # Data models and event arguments
└── Dialogs/                  # Custom dialog windows

Key Services

High-Performance Services

  • HighPerformanceBoundaryFilter: Parallel boundary filtering with bounding box optimization
  • HighPerformanceFilter: Multi-threaded GPS point filtering
  • StreamingDemService: Memory-efficient DEM generation for massive datasets
  • RgFdemExportService: Agricultural-optimized single-file export

Export Services

  • RgFdemExportService: Creates .RgFdem files for ABLS integration
  • GdalExportService: GeoTIFF export with GDAL integration
  • StreamingExportService: Large dataset export handling

πŸ”§ Technical Requirements

System Requirements

  • OS: Windows 10/11 (x64)
  • Framework: .NET 8.0
  • RAM: 8GB minimum, 16GB+ recommended for large datasets
  • Storage: SSD recommended for large GPS file processing

Dependencies

  • .NET 8.0 Windows: Core framework
  • WPF: User interface framework
  • GMap.NET: Interactive mapping and satellite imagery
  • GDAL: Geospatial data processing and GeoTIFF export
  • Triangle.NET: Delaunay triangulation for DEM generation
  • SQLite: Data storage and indexing
  • Ookii.Dialogs: Enhanced file dialogs

πŸ“¦ Installation

Prerequisites

  1. Install .NET 8.0 Runtime
  2. Install Visual Studio 2022 (for development)

Building from Source

git clone https://github.com/yourusername/DEMBuilder.git
cd DEMBuilder
dotnet restore
dotnet build --configuration Release

Running the Application

dotnet run
# OR
DEMBuilder.exe

🎯 Usage Guide

Step-by-Step Workflow

1. Load GPS Data

  • Import NMEA files from GPS logging devices
  • Supports multiple file selection
  • Automatic parsing of GPS coordinates, HDOP, RTK status, and timestamps

2. Filter GPS Points

  • HDOP Filter: Remove points with poor horizontal accuracy
  • RTK Status Filter: Keep only RTK Fixed/Float points
  • Age Filter: Remove points with old differential corrections
  • Real-time progress tracking with parallel processing

3. Define Field Boundary

  • Interactive satellite map view
  • Draw boundary polygon by clicking points
  • Visual feedback with GPS points overlay
  • High-performance boundary filtering with progress tracking

4. Set Coordinate System

  • Automatic reference point calculation
  • AgOpenGPS-compatible local tangent plane projection
  • Manual reference coordinate adjustment if needed

5. Generate DEM

  • Delaunay triangulation of GPS points
  • Configurable resolution (default: 0.25m/pixel)
  • Memory-efficient processing for large datasets

6. Preview Results

  • Visual DEM preview with elevation coloring
  • Quality assessment before export

7. Export DEM

Choose from multiple export formats:

RgF DEM (.RgFdem) - Recommended

  • Single-file agricultural package
  • Optimized for ABLS tractor software
  • Filename: Farm_Field_ddmmyy.RgFdem
  • Contains: metadata, binary elevation data, coordinate system info

GeoTIFF (.tif)

  • AgOpenGPS-compatible format
  • Tiled output for large areas
  • GDAL-based export with proper georeferencing

Text File (.txt/.asc)

  • ASCII grid format
  • Human-readable elevation data
  • Compatible with GIS software

πŸ“ File Formats

RgF DEM Format (.RgFdem)

The proprietary RgF DEM format is a ZIP-based container optimized for agricultural use:

Farm_Field_ddmmyy.RgFdem
β”œβ”€β”€ metadata.json           # Complete DEM parameters and bounds
β”œβ”€β”€ elevation.dem          # Binary elevation data (int32 header + float32 grid)
β”œβ”€β”€ coordinate_system.txt  # AgOpenGPS coordinate system info
└── README.txt            # Human-readable documentation

Key Features:

  • Single file for easy transfer
  • Optimized for USB drives and wireless transfer
  • AgOpenGPS-compatible coordinate system
  • Complete metadata for ABLS integration

See RgF_DEM_File_Format_Specification.md for complete technical details.

⚑ Performance Optimizations

Large Dataset Handling

  • Streaming Processing: Process datasets larger than available RAM
  • Parallel Filtering: Multi-core CPU utilization for point filtering
  • Bounding Box Optimization: 80-90% reduction in polygon tests
  • Memory Management: Efficient memory usage for 600,000+ point datasets

UI Responsiveness

  • Asynchronous Operations: Non-blocking UI during processing
  • Progress Reporting: Real-time progress updates every 1000 points or 100ms
  • Cancellation Support: User can cancel long-running operations
  • Visual Feedback: Progress bars and status messages throughout

Export Optimization

  • Chunked Processing: Process large DEMs in manageable chunks
  • Compression: ZIP-based containers for smaller file sizes
  • Binary Formats: Efficient storage of elevation data
  • Parallel Export: Multi-threaded export processing

πŸ”§ Configuration

Default Settings

  • Resolution: 0.25 meters/pixel
  • Tile Size: 50 meters (for GeoTIFF export)
  • Batch Size: 10,000 points for parallel processing
  • Progress Updates: Every 1,000 points or 100ms
  • Coordinate System: Local tangent plane (AgOpenGPS compatible)

Customization

Settings can be adjusted in the UI:

  • Export resolution and tile size
  • Filter thresholds (HDOP, Age)
  • Reference coordinates
  • Farm and field names

πŸ› Troubleshooting

Common Issues

GDAL Initialization Failed

  • Ensure GDAL native libraries are properly installed
  • Check GDAL_DATA environment variable
  • Verify all GDAL DLLs are in the application directory

Out of Memory Errors

  • Use streaming processing for datasets >500,000 points
  • Increase system RAM or use smaller data chunks
  • Close other applications to free memory

Slow Performance

  • Ensure SSD storage for large GPS files
  • Use parallel processing (enabled by default)
  • Consider reducing dataset size or resolution

Export Failures

  • Check available disk space
  • Verify write permissions to output directory
  • Ensure valid farm/field names (no special characters)

Debug Information

  • Debug logs are written to debug.log in the application directory
  • GDAL diagnostic information available in export dialogs
  • Progress and performance metrics displayed during operations

🀝 Contributing

Development Setup

  1. Clone the repository
  2. Install Visual Studio 2022 with .NET 8.0 support
  3. Restore NuGet packages: dotnet restore
  4. Build solution: dotnet build

Code Structure

  • Follow existing naming conventions
  • Use async/await for long-running operations
  • Implement progress reporting for user operations
  • Add comprehensive error handling
  • Include XML documentation for public APIs

Testing

  • Test with large datasets (100,000+ points)
  • Verify memory usage and performance
  • Test all export formats
  • Validate coordinate system accuracy

πŸ“„ License

This project is open source. See LICENSE file for details.

🏒 ABLS Integration

DEMBuilder is designed to integrate seamlessly with ABLS (Agricultural Baseline Location System) tractor software:

  • RgF DEM Format: Optimized for ABLS consumption
  • Coordinate System: AgOpenGPS-compatible local tangent plane
  • File Transfer: Single files optimized for USB and wireless transfer
  • Metadata: Complete technical specifications for integration

For ABLS developers, see RgF_DEM_File_Format_Specification.md for complete integration details.

πŸ“ž Support

For technical support or questions:

  • Review troubleshooting section above
  • Check debug logs for error details
  • Ensure system meets minimum requirements
  • Verify GPS data format compatibility (NMEA)

πŸ”„ Version History

Latest Version

  • βœ… RgF DEM export format with single-file packages
  • βœ… High-performance parallel processing for large datasets
  • βœ… Interactive boundary selection with progress tracking
  • βœ… Multiple export formats (RgF DEM, GeoTIFF, Text)
  • βœ… AgOpenGPS-compatible coordinate system
  • βœ… Comprehensive error handling and user feedback
  • βœ… Memory-efficient streaming processing
  • βœ… Visual progress bars throughout application

Key Improvements

  • Performance: 10x faster boundary filtering with parallel processing
  • Memory: Streaming algorithms support unlimited dataset sizes
  • UI/UX: Progress bars and responsive interface
  • Export: Single-file RgF DEM format for agricultural use
  • Compatibility: Full AgOpenGPS coordinate system support
  • Reliability: Comprehensive error handling and recovery

DEMBuilder - Precision agriculture starts with precise elevation data. πŸšœπŸ“Š

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages