Package madrona :: Package manipulators :: Module manipulators :: Class ClipToShapeManipulator
[hide private]

Class ClipToShapeManipulator

source code

     object --+    
              |    
BaseManipulator --+
                  |
                 ClipToShapeManipulator


required arguments:
    target_shape: GEOSGeometry of the shape to be clipped, in srid GEOMETRY_CLIENT_SRID (4326)
    clip_against: GEOSGeometry of the shape to clip against, in srid GEOMETRY_CLIENT_SRID (4326)
    zero: this value may be used to prevent issues that seem to arise from trying to simplify very small geometric results 
concerning **kwargs:
    kwargs is included to prevent errors resulting from extra arguments being passed to this manipulator from the generic view
manipulate() return value:
    a call to self.result() 
    with required parameter 'clipped_shape': 
        The returned shape geometry should be in srid GEOMETRY_CLIENT_SRID (4326) 
        The clipped shape will be the largest (in area) polygon result from intersecting 'target_shape' with 'clip_against' 
    and optional parameters 'html' and 'success':
        The html is usually a template that will be displayed to the client, explaining the manipulation
        if not provided, this will remain empty
        The success parameter is defined as '1' for success and '0' for failure
        if not provided, the default value, '1', is used

html_templates=='internal'   
                    This represents an 'internal error' and is accessed by raising a ManipulatorInternalException
                    This should occur under the following circumstances:
                        if geometry can not be generated from "clip_against" 
                        or intersection call failed
                    clipped_shape will be returned as None
html_templates=='invalid_geom'   
                    This represents a 'user error' and is accessed by raising an InvalidGeometryException
                    This should occur under the following circumstances:
                        if geometry can not be generated from "target_shape" 
                        or if "target_shape" is not a valid geometry
                    clipped_shape will be returned as None         
html_templates==2   clipped shape is empty (no overlap with "clip_against")
html_templates==0   if "target_shape" is successfully clipped to "clip_against"

Nested Classes [hide private]
  Options

Inherited from BaseManipulator: Form, HaltManipulations, InternalException, InvalidGeometryException

Instance Methods [hide private]
 
__init__(self, target_shape, clip_against=None, zero=0.0, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
manipulate(self) source code

Inherited from BaseManipulator: do_template, result, target_to_valid_geom

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, target_shape, clip_against=None, zero=0.0, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

manipulate(self)

source code 
Overrides: BaseManipulator.manipulate