def merge(file, names, config, coord):
 inputs = get_tiles(names, config, coord)
 output = {'type': 'Topology', 'transform': inputs[0]['transform'], 'objects': dict(), 'arcs': list()}
 for (name, input) in zip(names, inputs):
  for (index, object) in enumerate(input['objects'].values()):
   if (len(input['objects']) > 1):
    output['objects'][('%(name)s-%(index)d' % locals())] = object
   else:
    output['objects'][name] = object
   for geometry in object['geometries']:
    update_arc_indexes(geometry, output['arcs'], input['arcs'])
 file.write(json.dumps(output, separators=(',', ':')).encode('utf8'))

def merge ( file , names , config , coord ) : inputs = get_tiles ( names , config , coord ) output = { 'type' : 'Topology' , 'transform' : inputs [ 0 ] [ 'transform' ] , 'objects' : dict ( ) , 'arcs' : list ( ) } for ( name , input ) in zip ( names , inputs ) : for ( index , object ) in enumerate ( input [ 'objects' ] . values ( ) ) : if ( len ( input [ 'objects' ] ) > 1 ) : output [ 'objects' ] [ ( '%(name)s-%(index)d' % locals ( ) ) ] = object else : output [ 'objects' ] [ name ] = object for geometry in object [ 'geometries' ] : update_arc_indexes ( geometry , output [ 'arcs' ] , input [ 'arcs' ] ) file . write ( json . dumps ( output , separators = ( ',' , ':' ) ) . encode ( 'utf8' ) )
merges all .