An optimization tool for TopSky and GroundRadar map files. This tool applies the Ramer-Douglas-Peucker (RDP) algorithm to significantly reduce coordinate density in large map sectors while maintaining logical integrity and visual precision.
- Safety Guards:
- Chain Detection: Detects connected lines and only simplifies them if they form a significant chain (>3 segments).
- Infrastructure Protection: Isolated segments (like runway lines) and small polygons (<5 points) are preserved exactly as they appear in the source.
- Redundant Data Cleaning: Automatically removes zero-length segments and duplicate points that often bloat exported SCT data.
| File Type | Original Size | Optimized Size | Reduction |
|---|---|---|---|
| SKBO TMA | 6.6 KB | 3.2 KB | ~50.8% |
| SKRG | 547.0 KB | 123.3 KB | ~77.5% |
- Place your source files in the
Inputfolder. - Run the optimization script:
To use a custom simplification threshold (epsilon):
python CoordinateReducer.py
python CoordinateReducer.py --epsilon 0.00005
- Find your optimized, high-performance files in the
Outputfolder.
You can fine-tune the simplification threshold (epsilon) directly from the command line. The default is 0.00001 (approximately 1 meter). Higher values will simplify the paths more aggressively, while lower values will preserve more detail.
You can also specify custom input/output directories:
python CoordinateReducer.py --input MySourceDir --output MyResultDirThe tool uses a non-destructive parsing approach. Any lines that are NOT coordinates or lines (like COLOR:, FOLDER:, ZOOM:, or comments) are passed through exactly as they were. When a segment is small enough to not require simplification, the script reuses the original string from the file to ensure 100% precision and zero floating-point drift.