def run_extraction(self, file_path):
      # extract ways
      cache_path = file_path + '.json'

      if os.path.exists(cache_path):
        t0 = time.time()
        with open(cache_path, 'r') as outfile:
          self.extracter.ways = json.load(outfile)
        t1 = time.time()      
        elapsed = "{0:.1f}".format(t1-t0)
        print "USING CACHED WAYS from pbf file {}, fetched from disk in {}s".format(file_path, elapsed)
        return

      t0 = time.time()
      self.extracter.apply_file(file_path, locations=True)
      t1 = time.time()      
      elapsed = "{0:.1f}".format(t1-t0)
      print "EXTRACTED WAYS with locations from pbf file {}, took {}s".format(file_path, elapsed)
      with open(cache_path, 'w') as outfile:
        json.dump(self.extracter.ways, outfile)
dataset/ETHPy150Open trailbehind/DeepOSM/src/download_labels.py/WayMap.run_extraction/original