def get_cell_for_tile(self, tile):
"""
Returns the cell corresponding to the given GLCF tile. The tile
is identified by its UTM identifier (e.g. HG5152)
"""
assert self.cell_width == self.GLCF_tile_width
assert self.cell_height == self.GLCF_tile_height
row_from = tile[0]
row_to = tile[1]
col_from = int(tile[2:4])
col_to = int(tile[4:6])
i = self.ROW_MAP[row_from.upper()] / 2
j = (col_from - 1) / 2
# print "GLCF cell ", i, j
fracnum = np.ravel_multi_index((i, j), (self.n_cells_y, self.n_cells_x))
return fracnum
评论列表
文章目录