parameters: (self, table, geom)
return_statement: return res if res else None
docstring: Calculate the real table extent.
docstring_summary: Calculate the real table extent.
docstring_tokens: Calculate the real table extent .
function: def getTableExtent(self, table, geom):
          """Calculate the real table extent."""
          schema, tablename = self.getSchemaTableName(table)
          tableQuote = u"'{0}.{1}'".format(schema, tablename)
          # Extent calculation without spatial index
          extentFunction = u"""SDO_AGGR_MBR("{0}")""".format(geom)
          fromTable = u'"{0}"."{1}"'.format(schema, tablename)
  
          # if table as spatial index:
          indexes = self.getTableIndexes(table)
          if indexes:
              if u"SPATIAL_INDEX" in [f[2] for f in indexes]:
                  extentFunction = u"SDO_TUNE.EXTENT_OF({0}, {1})".format(
                      tableQuote, self.quoteString(geom))
                  fromTable = u"DUAL"
  
          sql = u"""
          SELECT
          SDO_GEOM.SDO_MIN_MBR_ORDINATE({0}, 1),
          SDO_GEOM.SDO_MIN_MBR_ORDINATE({0}, 2),
          SDO_GEOM.SDO_MAX_MBR_ORDINATE({0}, 1),
          SDO_GEOM.SDO_MAX_MBR_ORDINATE({0}, 2)
          FROM {1}
          """.format(extentFunction, fromTable)
  
          try:
              c = self._execute(None, sql)
          except DbError:  # no spatial index on table, try aggregation
              return None
  
          res = self._fetchone(c)
          c.close()
  
          if not res:
              res = None
  
          return res if res else None
function_tokens: def getTableExtent ( self , table , geom ) : schema , tablename = self . getSchemaTableName ( table ) tableQuote = u"'{0}.{1}'" . format ( schema , tablename ) # Extent calculation without spatial index extentFunction = u"""SDO_AGGR_MBR("{0}")""" . format ( geom ) fromTable = u'"{0}"."{1}"' . format ( schema , tablename ) # if table as spatial index: indexes = self . getTableIndexes ( table ) if indexes : if u"SPATIAL_INDEX" in [ f [ 2 ] for f in indexes ] : extentFunction = u"SDO_TUNE.EXTENT_OF({0}, {1})" . format ( tableQuote , self . quoteString ( geom ) ) fromTable = u"DUAL" sql = u"""
          SELECT
          SDO_GEOM.SDO_MIN_MBR_ORDINATE({0}, 1),
          SDO_GEOM.SDO_MIN_MBR_ORDINATE({0}, 2),
          SDO_GEOM.SDO_MAX_MBR_ORDINATE({0}, 1),
          SDO_GEOM.SDO_MAX_MBR_ORDINATE({0}, 2)
          FROM {1}
          """ . format ( extentFunction , fromTable ) try : c = self . _execute ( None , sql ) except DbError : # no spatial index on table, try aggregation return None res = self . _fetchone ( c ) c . close ( ) if not res : res = None return res if res else None