Package madrona :: Package features :: Module models :: Class SpatialFeature
[hide private]

Class SpatialFeature

source code

django.contrib.gis.db.models.Model --+    
                                     |    
                               Feature --+
                                         |
                                        SpatialFeature


Abstract Model used for representing user-generated geometry features. 
Inherits from Feature and adds geometry-related methods/properties
common to all geometry types.

    ======================  ==============================================
    Attribute               Description
    ======================  ==============================================
    ``user``                Creator

    ``name``                Name of the object

    ``date_created``        When it was created

    ``date_modified``       When it was last updated.

    ``manipulators``        List of manipulators to be applied when geom
                            is saved.
    ======================  ==============================================

Nested Classes [hide private]
  Meta
Instance Methods [hide private]
 
save(self, *args, **kwargs) source code
 
geom_kml(self)
Basic KML representation of the feature geometry
source code
 
kml(self)
Fully-styled KML placemark representation of the feature.
source code
 
kml_style(self)
Must return a string with one or more KML Style elements whose id's may be referenced by relative URL from within the feature's .kml string In any given KML document, each *unique* kml_style string will get included so don't worry if you have 10 million features with "blah-default" style...
source code
 
active_manipulators(self)
This method contains all the logic to determine which manipulators get applied to a feature
source code
 
apply_manipulators(self, force=False) source code

Inherited from Feature: __repr__, __unicode__, add_to_collection, copy, get_absolute_url, hash, is_viewable, kml_safe, options, remove_from_collection, share_with, uid

Class Methods [hide private]
 
mapnik_style(self)
Mapnik style object containing rules for symbolizing features in staticmap
source code

Inherited from Feature: css, get_options, model_uid

Class Variables [hide private]
  manipulators = models.TextField(verbose_name= "Manipulator Lis...

Inherited from Feature: collection, content_type, date_created, date_modified, name, object_id, objects, sharing_groups, user

Method Details [hide private]

save(self, *args, **kwargs)

source code 
Overrides: Feature.save

geom_kml(self)

source code 

Basic KML representation of the feature geometry

Decorators:
  • @property

kml(self)

source code 

Fully-styled KML placemark representation of the feature. The Feature's kml property MUST

  • return a string containing a valid KML placemark element
  • the placemark must have id= [the feature's uid]
  • if it references any style URLs, the corresponding Style element(s) must be provided by the feature's .kml_style property
Decorators:
  • @property

kml_style(self)

source code 

Must return a string with one or more KML Style elements whose id's may be referenced by relative URL from within the feature's .kml string In any given KML document, each *unique* kml_style string will get included so don't worry if you have 10 million features with "blah-default" style... only one will appear in the final document and all the placemarks can refer to it. BEST TO TREAT THIS LIKE A CLASS METHOD - no instance specific vars.

Decorators:
  • @property

active_manipulators(self)

source code 

This method contains all the logic to determine which manipulators get applied to a feature

If self.manipulators doesnt exist or is null or blank, 
   apply the required manipulators (or the NullManipulator if none are required)

If there is a self.manipulators string and there are optional manipulators contained in it,
   apply the required manipulators PLUS the specified optional manipulators

Decorators:
  • @property

Class Variable Details [hide private]

manipulators

Value:
models.TextField(verbose_name= "Manipulator List", null= True, blank= \
True, help_text= 'csv list of manipulators to be applied')