Rendering¶
Filters starting with render_ end a pipeline and turn features into map statements. Like the
feat_ filters, they accept single features, lists, dicts and bare geometries.
Most renderers take an optional label. If given, it is written as a comment line before the
output (// C1), which makes generated files easier to read.
Overview¶
| Filter | GRP | TopSky | Draws |
|---|---|---|---|
render_grp |
✓ | Everything, by geometry type | |
render_ts |
✓ | Everything, by geometry type | |
render_area |
✓ | Filled or outlined areas (COORDTYPE) |
|
render_line |
✓ | ✓ | Lines and outlines (LINE) |
render_polyline |
✓ | Lines and outlines (COORDTYPE:…:POLYLINE) |
|
render_coordline |
✓ | Lines and outlines (COORDLINE) |
|
render_coordpoly |
✓ | Filled areas (COORDPOLY) |
|
render_coords |
✓ | ✓ | Plain COORD lines, e.g. for stands |
render_symbol |
✓ | ✓ | Symbols, optionally labelled |
render_text |
✓ | ✓ | Text labels |
What cannot be drawn
Neither plugin supports holes in areas. Areas with holes are drawn without them, and mapbuilder
logs a warning. Geometries a renderer cannot draw, such as points in render_area, are skipped
with a warning that names the feature.
Render by geometry type¶
render_grp¶
Renders every part for Ground Radar according to its geometry type:
| Geometry | Output |
|---|---|
| Polygon, closed ring | COORDTYPE:<area> followed by COORD lines |
| Line | LINE statements, or with lines='polyline' a COORDTYPE:OTHER:POLYLINE block |
| Point | SYMBOL:<symbol>:… – points are skipped with a warning if no symbol is given |
COLOR:closure
{{ data.eddp_kml['Construction'] | render_grp(area='TWYCLOSED:REGION', symbol='CROSS') }}
lines='polyline' produces smaller files than LINE statements, because every point is written only
once.
render_ts¶
Renders every part for TopSky according to its geometry type:
| Geometry | Output |
|---|---|
| Polygon, closed ring | COORD lines followed by COORDPOLY:<fill> |
| Line | COORD lines followed by COORDLINE |
| Point | SYMBOL:<symbol>:… – points are skipped with a warning if no symbol is given |
fill must be a fill pattern.
COLOR:River
{% for name, river in data.rivers.items() %}
{{- river | feat_simplify(0.000005) | render_ts(label=name) }}
{% endfor %}
Areas¶
render_area¶
GRP. Renders each polygon as a COORDTYPE:<area_def> line followed by its COORD lines. If
color is given, a COLOR: line is written first.
area_def is everything after COORDTYPE: and follows the GRP syntax
AreaType:DrawType[:HatchType[:FillType]]:
- AreaType:
OTHER(plain drawing),TWYCLOSED,RWYCLOSED,APW,AREATYPEorTWYTYPE - DrawType:
REGION(filled with outline),REGION_FILLONLY,POLYGON(outline only),POLYLINEorNONE - HatchType (optional):
/,\,+,X,-,|or0(none) - FillType (optional): a fill pattern
{{ data.eddm['ApronElement'] | render_area('OTHER:REGION') }}
{{ snow_areas | render_area('OTHER:REGION:/') }} {# hatched #}
COORDTYPE:OTHER:REGION
COORD:48.3561234:11.7812345
COORD:48.3562345:11.7823456
COORD:48.3551234:11.7824567
COORD:48.3561234:11.7812345
Tip
For AREATYPE and TWYTYPE areas, GRP expects the RESTRICTION: lines before the
COORDTYPE line, so write them into the template before the render_area call.
render_coordpoly¶
TopSky. Renders each polygon as COORD lines followed by COORDPOLY:<fill>. If color is given,
a COLOR: line is written first. fill must be a fill pattern.
Lines¶
render_line¶
GRP and TopSky. Renders lines as LINE statements, one per segment. Polygons are drawn as
outlines, including their holes.
// C1
LINE:48.3501234:11.7712345:48.3502345:11.7723456
LINE:48.3502345:11.7723456:48.3503456:11.7734567
render_polyline¶
GRP. Renders each line as one COORDTYPE:<line_def> block followed by its COORD lines. Polygons
are drawn as outlines, including their holes. This is more compact than render_line.
render_coordline¶
TopSky. Renders each line as COORD lines followed by COORDLINE. Polygons are drawn as outlines,
including their holes.
Coordinates only¶
render_coords¶
GRP and TopSky. Writes only the COORD lines of a single line or polygon, for statements that
you write yourself, such as stand definitions:
{% set stands = data.eddm_stands['EDDM-stands'] %}
STAND:EDDM:101
{{ stands['101'] | render_coords }}
USE:C
CODE:C
If the input has more than one part, only the first one is written and a warning is logged.
Symbols and text¶
Symbols and text are placed at each point of a feature. For lines and areas, a point inside the geometry is used, so you can label an apron or taxiway area directly.
Labels are cleaned up automatically:
- Everything from a
#onwards is removed, so KML placemarks namedA#1andA#2are both labelledA. - Colons are replaced with spaces, because colons separate fields in both formats. A warning is logged.
- If you label with a property (
prop=…) that a feature does not have, a warning is logged and the feature gets no label.
render_symbol¶
GRP and TopSky. Writes a SYMBOL statement for each point. The symbol must be defined in your
maps file (SYMBOLDEF) or be a built-in symbol of the plugin.
To add a label, pass a fixed text or the name of a property with prop. offset moves the label
by pixels: x to the right, y downwards.
{{ data.eddp_kml['RRS']['08L_2400'] | render_symbol('rrs-down') }}
{{ stands | render_symbol('stand', prop='designator', offset=(0, 12)) }}
render_text¶
GRP and TopSky. Writes a TEXT statement for each point, with either a fixed text or the value
of property prop.
offset=(x, y)moves the text by pixels: x to the right, y downwards.alignsets the alignment: one ofL,C,R(horizontal) followed by one ofT,C,B(vertical), e.g.'LT'for left/top. Without it, the default alignment of the map applies.
{{ data.eddp_kml['Labels'] | render_text(prop='name') }}
{{ holding_points | render_text(text='CAT II', offset=(10, -5), align='LC') }}
Fill patterns¶
render_ts, render_coordpoly and the FillType of render_area accept these fill patterns, as
defined by both plugins:
| Value | Meaning |
|---|---|
0 |
No fill |
5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90 |
Fill percentage (a dot pattern) |
100 |
Solid fill |
E0 … E52 |
Hatch styles (GDI+ HatchStyle values) |
Any other value stops the build with an error, because the plugins would ignore it silently.
Output settings¶
The [render] section of mapbuilder.toml controls how the output is written.
[render]
# Decimal places of coordinates in generated maps (7 ~ 1 cm); omit for full precision
precision = 7
precision-
Number of decimal places for coordinates, from
0to15. Coordinates are rounded and trailing zeros are removed, e.g.48.3671551307609becomes48.3671551. Without this setting, coordinates are written with full precision. Seven decimal places are accurate to about 1 cm.The setting applies to all coordinates mapbuilder writes, including the older filters and the runway and ECL helpers. Coordinates you write into templates yourself are not changed.
Unknown settings in [render] stop the build with an error, so typos do not go unnoticed.