@staticmethod
def _compute_tile_extent(idx, tile_extent, stride, origin, image_size,
    include_nodata):
    """Method to compute tile extent: offset, extent for a given index
        """
    offset = idx * stride + origin
    if not include_nodata:
        extent = max(offset + tile_extent, 0) - max(offset, 0)
        extent = min(extent, image_size - offset)
        offset = max(offset, 0)
    else:
        extent = tile_extent
    return offset, extent
