def index_to_world(index, resolution, origin, width):
  """ Convert index to world coordinates """
  x = int(index % width); y = int(index // width)
  x = resolution * x + origin[0] + resolution / 2
  y = resolution * y + origin[1] + resolution / 2
  return x, y