# Navigate to mapbuilder
cd D:\GitHub\mapbuilder
# Install Poetry (Python package manager)
pip install poetry --break-system-packages
# Install mapbuilder dependencies
poetry install
# Verify installation
poetry run mapbuilder --helpExpected output:
usage: mapbuilder [options] target_dir
...
# Create test directory
mkdir D:\GitHub\mapbuilder-test
cd D:\GitHub\mapbuilder-test
# Create structure
mkdir mapdata
mkdir outputCreate D:\GitHub\mapbuilder-test\mapdata\mapbuilder.toml:
# Simple test configuration
[data.test_text]
type = "raw"
source = "test_data.txt"
[runways.CYHZ]
"05" = { heading = 51, lat = 44.8758, lon = -63.5086 }
"14" = { heading = 141, lat = 44.8847, lon = -63.4997 }
"23" = { heading = 231, lat = 44.8942, lon = -63.5244 }
"32" = { heading = 321, lat = 44.8853, lon = -63.5333 }Create D:\GitHub\mapbuilder-test\mapdata\test_data.txt:
This is test data for mapbuilder.
It will be included in the output.
Create D:\GitHub\mapbuilder-test\mapdata\TestOutput.txt.jinja:
; Generated by Mapbuilder
; Date: {{ now }}
; Test Data
{{ data.test_text }}
; CYHZ Runways
{% for rwy_id, rwy_data in runways.CYHZ.items() %}
; Runway {{ rwy_id }}: Heading {{ rwy_data.heading }}°
; Location: {{ rwy_data.lat }}, {{ rwy_data.lon }}
{% endfor %}
; End of test filecd D:\GitHub\mapbuilder
poetry run mapbuilder D:\GitHub\mapbuilder-test\output -s D:\GitHub\mapbuilder-test\mapdataExpected output:
INFO Building...
INFO Done!
type D:\GitHub\mapbuilder-test\output\TestOutput.txtYou should see:
; Generated by Mapbuilder
; Date: 2024-11-30 ...
; Test Data
This is test data for mapbuilder.
It will be included in the output.
; CYHZ Runways
; Runway 05: Heading 51°
; Location: 44.8758, -63.5086
; Runway 14: Heading 141°
; Location: 44.8847, -63.4997
; Runway 23: Heading 231°
; Location: 44.8942, -63.5244
; Runway 32: Heading 321°
; Location: 44.8853, -63.5333
; End of test file
If you see the output above, mapbuilder is working!
Update mapdata/mapbuilder.toml:
[data.czqm_runways]
type = "sct"
source = "D:/GitHub/CZQM-vACC/dev/TestSectorFiles/CZQQ.sct" # Adjust path
[runways.CYHZ]
"05" = { heading = 51 }
"14" = { heading = 141 }
"23" = { heading = 231 }
"32" = { heading = 321 }Create mapdata/RunwayTest.txt.jinja:
; CZQM Runways from Sector File
; Generated {{ now }}
{% for airport, rwys in data.czqm_runways.RUNWAY.items() %}
; Airport: {{ airport }}
{% for rwy in rwys %}
; Runway {{ rwy.id }}: {{ rwy.heading }}° - {{ rwy.lat }}, {{ rwy.lon }}
{% endfor %}
{% endfor %}Run:
poetry run mapbuilder D:\GitHub\mapbuilder-test\output -s D:\GitHub\mapbuilder-test\mapdataCheck:
type D:\GitHub\mapbuilder-test\output\RunwayTest.txt- ✅ How to install mapbuilder
- ✅ How to create configuration files
- ✅ How to use Jinja2 templates
- ✅ How to run the tool
- ✅ How to reference your sector files
{{ variable }} {# Output a variable #}
{{ data.source_name }} {# Access data source #}
{{ runways.CYHZ }} {# Access configuration #}{% for item in list %}
{{ item }}
{% endfor %}{% if condition %}
True branch
{% else %}
False branch
{% endif %}{# This is a comment #}-
Try GeoJSON data:
- Create simple polygon
- Render as TopSky COORD lines
-
Parse ESE files:
- Load SID/STAR procedures
- Generate procedure definitions
-
Use geometry functions:
- Simplify complex shapes
- Combine polygons
- Buffer zones
Create Class G airspace from GeoJSON:
mapdata/class_g.geojson:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": { "name": "CLASS_G_TEST" },
"geometry": {
"type": "Polygon",
"coordinates": [[
[-63.5, 44.5],
[-63.0, 44.5],
[-63.0, 45.0],
[-63.5, 45.0],
[-63.5, 44.5]
]]
}
}
]
}mapdata/mapbuilder.toml:
[data.class_g]
type = "geojson"
source = "class_g.geojson"mapdata/ClassG.txt.jinja:
; Class G Airspace
{% for feature in data.class_g %}
COORD:{{ feature.properties.name }}
{% for coord in feature.geometry.coordinates[0] %}
{{ coord[1] }}:{{ coord[0] }}
{% endfor %}
{% endfor %}- Check that
mapbuilder.tomlis in the source directory - Verify path with
-sflag
- Run
poetry installagain - Make sure you're using
poetry run
- Check template syntax
- Verify data sources are loading
- Use
--debugflag for more info:poetry run mapbuilder D:\output -s D:\mapdata --debug
- Check Jinja2 syntax
- Verify variable names match config
- Test with simpler template first
In 15 minutes, you:
- ✅ Installed mapbuilder
- ✅ Created a test project
- ✅ Wrote a template
- ✅ Generated output
- ✅ Understand the workflow
Now you can:
- Experiment with real CZQM data
- Create TopSky map sections
- Automate repetitive tasks
- Integrate with your workflow
Try generating a real TopSky map section:
- Pick one simple feature (e.g., one sector boundary)
- Create GeoJSON or parse from sector file
- Write template in TopSky format
- Compare with your manual version
Good luck! 🚀