safe.report.impact_report module

Module to generate impact report using QgsComposition.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.report.impact_report.ImpactReport(iface, template, layer)[source]

Bases: object

A class for creating report using QgsComposition.

component_ids[source]

Getter to the component ids

composition[source]

Getter to QgsComposition instance.

disclaimer[source]

Getter to disclaimer.

draw_composition()[source]

Draw all the components in the composition.

extent[source]

Getter to extent for map component in composition.

Getter to safe logo path.

Changed in version 3.2: - this property is now read only.

layer[source]

Getter to layer that will be used for stats, legend, reporting.

load_template()[source]

Load the template to composition.

map_legend_attributes[source]

Get the map legend attribute from the layer keywords if possible.

Returns:None on error, otherwise the attributes (notes and units).
Return type:None, str
map_title[source]

Get the map title from the layer keywords if possible.

Returns:None on error, otherwise the title.
Return type:None, str
missing_elements[source]

Getter to the missing elements.

north_arrow[source]

Getter to north arrow path.

Getter to organisation logo path.

page_dpi[source]

Getter to page resolution in dots per inch.

print_impact_table(output_path)[source]

Pint summary from impact layer to PDF.

..note:: The order of the report:
  1. Summary table
  2. Aggregation table
  3. Attribution table
Parameters:output_path (str) – Output path.
Returns:Path to generated pdf file.
Return type:str
Raises:None
print_map_to_pdf(output_path)[source]

Generate the printout for our final map as pdf.

Parameters:output_path (str) – Path on the file system to which the pdf should be saved. If None, a generated file name will be used.
Returns:File name of the output file (equivalent to filename if provided).
Return type:str
print_to_pdf(output_path)[source]

A wrapper to print both the map and the impact table to PDF.

Parameters:output_path (str) – Path on the file system to which the pdf should be saved. If None, a generated file name will be used. Note that the table will be prefixed with ‘_table’.
Returns:The map path and the table path to the pdfs generated.
Return type:tuple
setup_composition()[source]

Set up the composition ready.

Getter to supporters logo path - this is a read only property.

It always returns the InaSAFE supporters logo unlike the organisation logo which is customisable.

New in version 3.2.

template[source]

Getter to the template