code: def write_tile_if_changed(store, tile_data, coord, format):
      
  
      existing_data = store.read_tile(coord, format)
      if not existing_data or \
         not tiles_are_equal(existing_data, tile_data, format):
          store.write_tile(tile_data, coord, format)
          return True
      else:
          return False
docs: Only write tile data if different from existing.
  
      Try to read the tile data from the store first. If the existing
      data matches, don't write. Returns whether the tile was written.