Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

946 B
Raw Blame
{% macro power_lines_table(power_lines) -%}
<div class="table-wrapper">
  <table>
    <caption>Power Lines</caption>
    <thead>
      <tr>
        <th>Voltage</th>
        <th>Length</th>
        <th>Percentage</th>
      </tr>
    </thead>
    <tbody>
    {% for voltages, length in power_lines.lines.items() %}
      <tr>
        <td>{{voltages[0]|voltage}} &ndash; {% if voltages[1] %}{{(voltages[1] - 1000)|voltage}}{% endif %}</td>
        <td>{{length|distance}}</td>
        <td>{{(length / power_lines.total)|percent}}</td>
      </tr>
    {% endfor %}
      <tr>
        <td>No voltage tagged</td>
        <td>{{power_lines.unspecified|distance}}</td>
        <td>{{(power_lines.unspecified / power_lines.total)|percent}}</td>
      </tr>
    </tbody>
    <tfoot>
      <tr>
        <td>Total</td>
        <td>{{power_lines.total|distance}}</td>
        <td>{{1|percent}}</td>
      </tr>
    </tfoot>
  </table>
</div>
{%- endmacro %}