def _shift_required(tiles):
if tiles[<NUM_LIT:0>][<NUM_LIT:0>].tile_pyramid.is_global:<EOL><INDENT>tile_cols = sorted(list(set([t[<NUM_LIT:0>].col for t in tiles])))<EOL>if tile_cols == list(range(min(tile_cols), max(tile_cols) + <NUM_LIT:1>)):<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>def gen_groups(items):<EOL><INDENT>"""<STR_LIT>"""<EOL>j = items[<NUM_LIT:0>]<EOL>group = [j]<EOL>for i in items[<NUM_LIT:1>:]:<EOL><INDENT>if i == j + <NUM_LIT:1>:<EOL><INDENT>group.append(i)<EOL><DEDENT>else:<EOL><INDENT>yield group<EOL>group = [i]<EOL><DEDENT>j = i<EOL><DEDENT>yield group<EOL><DEDENT>groups = list(gen_groups(tile_cols))<EOL>if len(groups) == <NUM_LIT:1>:<EOL><INDENT>return False<EOL><DEDENT>normal_distance = groups[-<NUM_LIT:1>][-<NUM_LIT:1>] - groups[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>antimeridian_distance = (<EOL>groups[<NUM_LIT:0>][-<NUM_LIT:1>] + tiles[<NUM_LIT:0>][<NUM_LIT:0>].tile_pyramid.matrix_width(tiles[<NUM_LIT:0>][<NUM_LIT:0>].zoom)<EOL>) - groups[-<NUM_LIT:1>][<NUM_LIT:0>]<EOL>return antimeridian_distance < normal_distance<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Determine if distance over antimeridian is shorter than normal distance.