docs: def calc_distance_to_border(polygons, template_raster, dst_raster, overwrite=False,
                              keep_interim_files=False):
      """Calculate the distance of each raster cell (in and outside the polygons) to the next polygon border.
      
      Arguments:
          polygons {str} -- Filename to a geopandas-readable file with polygon features. 
          template_raster {[type]} -- Filename to a rasterio-readable file.
          dst_raster {[type]} -- Destination filename for the distance to polygon border raster file (tif).
      
      Keyword Arguments:
          overwrite {bool} -- Overwrite files if they exists? (default: {False})
          keep_interim_files {bool} -- Keep the interim line vector and raster files (default: {True})
      
      Returns:
          [type] -- [description]
      """
      if Path(dst_raster).exists() and not overwrite:
          print(f"Returning 0 - File exists: {dst_raster}")
          return 0
  
      with rasterio.open(template_raster) as tmp:
          crs = tmp.crs
          
      dst_raster = Path(dst_raster)
      dst_raster.parent.mkdir(exist_ok=True, parents=True)
  
      tempdir = Path(tempfile.mkdtemp(prefix=f"TEMPDIR_{dst_raster.stem}_", dir=dst_raster.parent))
      interim_file_lines_vector = tempdir / "interim_sample_vector_dataset_lines.shp"
      interim_file_lines_raster = tempdir / "interim_sample_vector_dataset_lines.tif"
  
      exit_code = convert_polygons_to_lines(polygons, 
                                            interim_file_lines_vector, 
                                            crs=crs, 
                                            add_allone_col=True)
      
      rasterize(src_vector=str(interim_file_lines_vector),
                burn_attribute="ALLONE",
                src_raster_template=str(template_raster),
                dst_rasterized=str(interim_file_lines_raster),
                gdal_dtype=1)
  
      cmd = f"{PROXIMITY_PATH} " \
            f"{str(Path(interim_file_lines_raster).absolute())} " \
            f"{str(Path(dst_raster).absolute())} " \
            f"-ot Float32 -distunits PIXEL -values 1 -maxdist 255"
      subprocess.check_call(cmd, shell=True)
      
      if not keep_interim_files:
          shutil.rmtree(tempdir)
      else:
          print(f"Interim files are in {tempdir}")
      return 0