safe.utilities.extent module

InaSAFE Disaster risk assessment tool by AusAid -ImpactCalculator.

The module provides a help to manage extent for analysis.

Refactor from dock.py, originally made by Tim Sutton.

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.utilities.extent.Extent(iface)[source]

Bases: object

Extent class to handle extent.

clear_user_analysis_extent()[source]

Slot called when the users clears the analysis extents.

define_user_analysis_extent(extent, crs)[source]

Slot called when user has defined a custom analysis extent.

Parameters:
  • extent (QgsRectangle) – Extent of the user’s preferred analysis area.
  • crs (QgsCoordinateReferenceSystem) – Coordinate reference system for user defined analysis extent.
hide_last_analysis_extent()[source]

Clear extent rubber band if any.

This method can safely be called even if there is no rubber band set.

New in version 2.1.0.

hide_next_analysis_extent()[source]

Hide the rubber band showing extent of the next analysis.

New in version 2.1.0.

hide_user_analysis_extent()[source]

Hide the rubber band showing extent of the next analysis.

show_last_analysis_extent(extent)[source]

Show last analysis extent as a rubber band on the canvas.

See also

hide_extent()

New in version 2.1.0.

Parameters:extent (QgsRectangle, list) – A rectangle to display on the canvas. If parameter is a list it should be in the form of [xmin, ymin, xmax, ymax] otherwise it will be silently ignored and this method will do nothing.
show_next_analysis_extent(next_analysis_extent)[source]

Update the rubber band showing where the next analysis extent is.

Primary purpose of this slot is to draw a rubber band of where the analysis will be carried out based on valid intersection between layers.

Parameters:next_analysis_extent (list) – The next analysis extent.

New in version 2.1.0.

show_user_analysis_extent()[source]

Update the rubber band showing the user defined analysis extent.

Primary purpose of this slot is to draw a rubber band of where the analysis will be carried out based on valid intersection between layers and the user’s preferred analysis area.

This slot is called on pan, zoom, layer visibility changes and when the user updates the defined extent.

New in version 2.2.0.

static validate_rectangle(extent)[source]
Parameters:extent
Returns:
Raises:InvalidGeometryError