Home | Trees | Indices | Help |
---|
|
object --+ | BaseManipulator
BaseManipulator should be used as the parent class to all manipulator classes. The manipulate() function should be overridden with suitable definition, it is this function that will be called automatically when your manipulator class is included in the Mpa.Options.manipulators list. This function generally takes as input a target shape geometry, and should return a call to result() containing the 'clipped_shape' and optionally a rendered template 'html' and 'success' value. 'clipped_shape' is the new shape as a result of the manipulator 'html' is generally a template that might be displayed by the client 'success' is a signal, '1' or '0', as to whether the manipulation succeeded or not The do_template() function can be used to render a template with appropriate context The target_to_valid_geom() function can be used to generate a geometry from target shape The result() function should be used for the manipulator return value to ensure that all necessary key/value pairs are provided. Three useful exceptions are provided as well: InternalException is used for exceptions or errors that are considered 'server-side' or 'out of the users control', such as failed database access, or failed geometry operation. InvalidGeometryException is used for exceptions or errors resulting from an innapropriate mpa geometry such as a point, line, or otherwise invalid geometry. HaltManipulations is used for errors, not already handled by InternalException or InvalidGeometryException, that should prevent any further manipulations from taking place. This could be useful in cases such as when an mpa geometry is outside of the study region. In such cases there is no need for further manipulations as such an mpa entry is already deemed inappropriate for our use.
|
|||
Form | |||
Options | |||
InternalException | |||
InvalidGeometryException | |||
HaltManipulations |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Oct 30 11:31:02 2012 | http://epydoc.sourceforge.net |