parameters: (quadtree_dir, shapes_dir, remove_duplicates=True, pattern="map*")
docstring: Merge multiple quadtree files into one, removing duplicates.
docstring_summary: Merge multiple quadtree files into one, removing duplicates.
docstring_tokens: Merge multiple quadtree files into one removing duplicates .
function: def merge_quadtrees(quadtree_dir, shapes_dir, remove_duplicates=True, pattern="map*"):
      """Merge multiple quadtree files into one, removing duplicates."""
      quadtree_files = glob.glob(os.path.join(quadtree_dir, pattern))
      assert quadtree_files
      cmd = ["merge"]
      if remove_duplicates:
          cmd.append("-u")
      cmd += ["-o", shapes_dir]  # Output to shapes directory
      cmd += quadtree_files  # input files
      subprocess.run(cmd, check=True, capture_output=True)
function_tokens: def merge_quadtrees ( quadtree_dir , shapes_dir , remove_duplicates = True , pattern = "map*" ) : quadtree_files = glob . glob ( os . path . join ( quadtree_dir , pattern ) ) assert quadtree_files cmd = [ "merge" ] if remove_duplicates : cmd . append ( "-u" ) cmd += [ "-o" , shapes_dir ] # Output to shapes directory cmd += quadtree_files # input files subprocess . run ( cmd , check = True , capture_output = True )