TopoConvert
A unified geospatial conversion toolkit for survey data processing and transformation.
Overview
TopoConvert is a Python-based command-line tool that provides a comprehensive set of utilities for converting and processing geospatial survey data between various formats including KML, CSV, and DXF. It's designed specifically for surveyors, GIS professionals, and engineers who need to transform topographical data efficiently.
Features
- Multiple Format Support: Convert between KML, CSV, and DXF formats
- Contour Generation: Create contour lines from point data with customizable intervals
- Mesh Generation: Generate triangulated meshes from survey points (with optional wireframe)
- Slope Analysis: Create slope heatmaps with contours, target slope settings, and color-blind friendly options
- GPS Grid Generation: Generate GPS grid layouts within property boundaries (supports convex/concave hulls)
- Batch Processing: Combine multiple CSV files into DXF (separate layers) or KML
- Coordinate System Support: Handle various projection systems via pyproj
- Smart Defaults: Optional output files automatically named based on input
- No Progress Bars: Clean, distraction-free command execution
- Production-Ready Robustness: Comprehensive edge case testing ensures reliable handling of real-world data quality issues
Requirements
- Python 3.9 or higher
- All dependencies automatically installed via pip
Installation
From Source (Development)
# Clone the repository
git clone https://github.com/DavGarcia/topoconvert.git
cd topoconvert
# Create a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
# Install development dependencies
pip install -e ".[dev]"
From PyPI
pip install topoconvert
Quick Start
TopoConvert provides a single CLI with multiple subcommands:
# Convert KML points to DXF contours (output file optional)
topoconvert kml-to-dxf-contours input.kml --interval 1.0
# Convert CSV to KML
topoconvert csv-to-kml survey_data.csv output.kml --add-labels
# Convert KML to CSV format
topoconvert kml-to-points input.kml output.csv --format csv
# Generate slope heatmap (output file optional, contours shown by default)
topoconvert slope-heatmap terrain.kml --target-slope 5.0
# Combine multiple CSV files to DXF on separate layers
topoconvert multi-csv-to-dxf file1.csv file2.csv file3.csv --output merged.dxf
# Combine multiple CSV files to KML
topoconvert multi-csv-to-kml file1.csv file2.csv file3.csv output.kml
Available Commands
Data Conversion
csv-to-kml- Convert CSV survey data to KML formatkml-to-points- Extract points from KML (supports DXF, CSV, JSON, TXT output)
DXF Generation
kml-to-dxf-contours- Generate contour lines from KML point datakml-to-dxf-mesh- Generate triangulated mesh from KML points (wireframe by default)kml-contours-to-dxf- Convert KML contour lines to DXF formatmulti-csv-to-dxf- Merge multiple CSV files to DXF on separate layers
KML Generation
multi-csv-to-kml- Combine multiple CSV files into a single KMLgps-grid- Generate GPS grid points within property boundaries
Analysis & Visualization
slope-heatmap- Generate slope analysis PNG (contours by default, color-blind friendly options)
For detailed usage of each command:
topoconvert <command> --help
Reliability & Testing
TopoConvert v0.1.2+ includes a comprehensive edge case testing system that ensures robust handling of real-world data challenges:
Data Quality Resilience
- Corrupted File Handling: Graceful failure with clear error messages for malformed KML, CSV, and DXF files
- Invalid Data Detection: Systematic handling of corrupted coordinates, missing headers, encoding issues, and inconsistent data structures
- Boundary Condition Testing: Validation with extreme coordinate values, minimal datasets, and edge cases
- Memory Efficiency: Stress testing with large datasets (50k+ points) and memory leak detection
Quality Assurance
- 88 Comprehensive Edge Case Tests: Covering corruption scenarios, memory limits, and boundary conditions
- Cross-Platform Reliability: Tests validated on Linux, Windows, and macOS with platform-specific optimizations
- Error Message Consistency: User-friendly error reporting with consistent exit codes across all commands
- Performance Regression Prevention: Automated benchmarking with threshold-based regression detection
- Production-Ready Validation: No crashes on corrupted input, proper cleanup, and informative feedback
Testing Infrastructure
# Run edge case tests
pytest tests/test_*corruption* tests/test_*memory* tests/test_*benchmark*
# Memory stress testing
pytest tests/test_memory_utils.py -v
# Performance benchmarking
pytest tests/test_benchmark_config.py -v
Development
Running Tests
# Run all tests (450+ tests including edge cases)
pytest
# Run with coverage
pytest --cov=topoconvert
# Run core functionality tests only
pytest tests/test_*.py -k "not (corruption or memory or benchmark)"
# Run specific test categories
pytest tests/test_kml_to_contours.py # Core functionality
pytest tests/test_*corruption* # Corruption handling
pytest tests/test_*memory* # Memory efficiency (cross-platform optimized)
pytest tests/test_*benchmark* # Performance testing
Note: All tests are optimized for cross-platform reliability and will adapt to different system environments automatically.
Code Quality
# Format code
black topoconvert/
# Lint code
flake8 topoconvert/
# Type checking
mypy topoconvert/
Contributing
Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
Documentation
Full documentation is available in the docs/ directory.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with Shapely for geometric operations
- Uses ezdxf for DXF file handling
- Powered by pandas for data manipulation
- Coordinate transformations via pyproj
- Quality assurance enhanced by:
- pytest-benchmark for performance regression testing
- Hypothesis for property-based testing
- psutil for system memory monitoring
Support
For bug reports and feature requests, please use the GitHub issue tracker.
Metadata
Release files for topoconvert 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| topoconvert-0.1.3.tar.gz | 97.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| topoconvert-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 157.9 kB
Release files / topoconvert-0.1.3.tar.gz
| Download URL | topoconvert-0.1.3.tar.gz |
|---|---|
| Size | 97.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d041582b2e16b4bc146b469ac3b1e4358f2b194bc0bca009b71731bb56054105
|
|
BLAKE2b-256 checksum How to use checksums |
efe692d9ce85a93228cbe60ea4409f7e75ed243b1d7fec6f13bc8b3900233f3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.
Transparency logRelease files / topoconvert-0.1.3-py3-none-any.whl
| Download URL | topoconvert-0.1.3-py3-none-any.whl |
|---|---|
| Size | 60.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c1a5e3a2c71abc98ba98e39e8d77c09d1793850492aac6f9030b7b3d5ea466e
|
|
BLAKE2b-256 checksum How to use checksums |
6d1d9317d84111eeba182f0194fd38df2cbd97497446d10a73b1df5076f9a53c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 7, 2025.
Transparency log