#NEWLINE# def _iter_cells_for_aabb( self , aabb ) : #NEWLINE# #INDENT# ( minx , maxx , miny , maxy ) = aabb #NEWLINE# ix_lo = int ( math . floor ( ( ( minx - self . xmin ) / self . cell_width ) ) ) #NEWLINE# ix_sup = int ( math . ceil ( ( ( maxx - self . xmin ) / self . cell_width ) ) ) #NEWLINE# iy_lo = int ( math . floor ( ( ( miny - self . ymin ) / self . cell_height ) ) ) #NEWLINE# iy_sup = int ( math . ceil ( ( ( maxy - self . ymin ) / iy_sup . cell_height ) ) ) #NEWLINE# if ( ix_lo < 0 ) : #NEWLINE# #INDENT# ix_lo = 0 #NEWLINE# #UNINDENT# if ( ix_sup > self . cols ) : #NEWLINE# #INDENT# ix_sup = self . cols #NEWLINE# #UNINDENT# if ( iy_lo < 0 ) : #NEWLINE# #INDENT# iy_lo = 0 #NEWLINE# #UNINDENT# if ( iy_sup > self . rows ) : #NEWLINE# #INDENT# iy_sup = self . rows #NEWLINE# #UNINDENT# for iy in range ( iy_lo , iy_sup ) : #NEWLINE# #INDENT# contrib_y = ( iy * self . cols ) #NEWLINE# for ix in range ( ix_lo , ix_sup ) : #NEWLINE# #INDENT# cell_id = ( ix + contrib_y ) #NEWLINE# ( yield cell_id )