Package madrona :: Package studyregion :: Module models :: Class StudyRegion
[hide private]

Class StudyRegion

source code

django.contrib.gis.db.models.Model --+
                                     |
                                    StudyRegion

Model used for representing study regions

======================  ==============================================
Attribute               Description
======================  ==============================================

``name``                Name of the Study Region

``active``              Whether the study region is treated as the
                        current authoritative copy. This should not be
                        set using the admin interface

``creation_date``       Automatically assigned

``modification_date``   Automatically assigned

``geometry``            PolygonField representing the study region boundary

``date_modified``       When the Study Region geometry was last updated.

``lookAt_Lat``          Latitude of the default look-at point

``lookAt_Lon``          Longitude of the default look-at point

``lookAt_Range``        Range camera sits from the default look-at point

``lookAt_Tilt``         Angle offset from vertical for default camera pos

``lookAt_Heading``      Angle offset from North for default camera pos

======================  ==============================================

Nested Classes [hide private]
  Meta
Instance Methods [hide private]
 
__unicode__(self) source code
 
save(self, *args, **kwargs) source code
 
get_absolute_url(self) source code
 
area_sq_mi(self)
WARNING: This method assumes that the native units of the geometry are meters.
source code
 
kml(self, style_domain)
Get the kml of the entire study region
source code
 
kml_chunk(self, n, s, e, w)
Get the kml of a lat/lon bounded part of the study region, with geometry simplified in proportion to the visible % of the region
source code
 
lookAtKml(self)
Get the kml for the region's lookat values saved in the DB, or compute them if they are set to 0
source code
 
cacheLookAt(self)
Compute and store the camera perspective that puts the whole study region in view
source code
Class Variables [hide private]
  name = models.CharField(verbose_name= "Study Region Name", max...
  active = models.BooleanField(default= False, help_text= 'This ...
  creation_date = models.DateTimeField(auto_now_add= True)
  modification_date = models.DateTimeField(auto_now= True)
  geometry = models.MultiPolygonField(srid= settings.GEOMETRY_DB...
  date_modified = models.DateTimeField(auto_now= True, verbose_n...
  lookAt_Lat = models.FloatField(default= 0, null= True, blank= ...
  lookAt_Lon = models.FloatField(default= 0, null= True, blank= ...
  lookAt_Range = models.FloatField(default= 80000, help_text= 'D...
  lookAt_Tilt = models.FloatField(default= 0, help_text= 'Degree...
  lookAt_Heading = models.FloatField(default= 0, help_text= 'Vie...
  objects = StudyRegionManager()
Method Details [hide private]

get_absolute_url(self)

source code 
Decorators:
  • @models.permalink

area_sq_mi(self)

source code 

WARNING: This method assumes that the native units of the geometry are meters. Returns the area of the study region in sq_mi

Decorators:
  • @property

Class Variable Details [hide private]

name

Value:
models.CharField(verbose_name= "Study Region Name", max_length= 255)

active

Value:
models.BooleanField(default= False, help_text= 'This options will usua\
lly not be set using the admin interface, but rather by using the mana\
gement commands relating to study region changes.')

geometry

Value:
models.MultiPolygonField(srid= settings.GEOMETRY_DB_SRID, null= True, \
blank= True, verbose_name= "Study region boundary")

date_modified

Value:
models.DateTimeField(auto_now= True, verbose_name= "Date Modified")

lookAt_Lat

Value:
models.FloatField(default= 0, null= True, blank= True)

lookAt_Lon

Value:
models.FloatField(default= 0, null= True, blank= True)

lookAt_Range

Value:
models.FloatField(default= 80000, help_text= 'Distance from lookAt poi\
nt in meters')

lookAt_Tilt

Value:
models.FloatField(default= 0, help_text= 'Degrees from vertical (0=dir\
ectly above)')

lookAt_Heading

Value:
models.FloatField(default= 0, help_text= 'View direction in degrees (0\
=look North)')