{# Macro that renders a bounding box element from feature list #} {% macro render_bounded_by(features) -%} {# first assemble all latitudes and longitudes #} {% set longitudes = [] %} {% set latitudes = [] %} {% for feature in features %} {% do longitudes.append(feature.lon) %} {% do latitudes.append(feature.lat) %} {% endfor %} {# use the maximum and minimum Jinja2 Filters to get max/min from lists #} {{ longitudes|minimum }} {{ latitudes|minimum }} {{ longitudes|maximum }} {{ latitudes|maximum }} {%- endmacro %} {# Macro that renders a name element #} {% macro render_name(name) -%} {{ name }} {%- endmacro %} {# Macro that renders any element with tag and content :-) #} {% macro render_element(tag, content) -%} <{{tag}}> {{ content }} {%- endmacro %}