original_docstring: 
      Takes a raster and applies a Lapalcian filter to it
  
      Args:
          in_file: input raster
          out_file: output raster
  
      Returns:
          Nothing
  
      
docstring: Takes a raster and applies a Lapalcian filter to it
docstring_tokens: Takes a raster and applies a Lapalcian filter to it
code: def generate_laplace(in_file, out_file):
      """
      Takes a raster and applies a Lapalcian filter to it
  
      Args:
          in_file: input raster
          out_file: output raster
  
      Returns:
          Nothing
  
      """
  
      print(f'Generating Laplacian texture: {out_file}')
  
      img = gdal.Open(in_file)
      ds = img.GetGeoTransform()
      ulx, xres, xskew, uly, yskew, yres = ds
      nx = img.RasterXSize
      ny = img.RasterYSize
  
      driver = gdal.GetDriverByName("GTiff")
      outdata = driver.Create(out_file, nx, ny, 1, gdal.GDT_Float32)
      outdata.SetGeoTransform(img.GetGeoTransform())  ##sets same geotransform as input
      outdata.SetProjection(img.GetProjection())  ##sets same projection as input
  
      in_band = img.GetRasterBand(1)
      in_array = in_band.ReadAsArray()
      nodata_val = in_band.GetNoDataValue()
      print('Filtering')
      array = ndi.laplace(in_array)
  
      print('Writing')
      outdata.GetRasterBand(1).WriteArray(array)
      outdata.GetRasterBand(1).SetNoDataValue(nodata_val)  ##if you want these values transparent
      outdata.FlushCache()  ##saves to disk!!
      outdata = None
      band = None
      ds = None
  
      print('Laplacian successfully generated')
code_tokens: def generate_laplace ( in_file , out_file ) : print ( f'Generating Laplacian texture: {out_file}' ) img = gdal . Open ( in_file ) ds = img . GetGeoTransform ( ) ulx , xres , xskew , uly , yskew , yres = ds nx = img . RasterXSize ny = img . RasterYSize driver = gdal . GetDriverByName ( "GTiff" ) outdata = driver . Create ( out_file , nx , ny , 1 , gdal . GDT_Float32 ) outdata . SetGeoTransform ( img . GetGeoTransform ( ) ) outdata . SetProjection ( img . GetProjection ( ) ) in_band = img . GetRasterBand ( 1 ) in_array = in_band . ReadAsArray ( ) nodata_val = in_band . GetNoDataValue ( ) print ( 'Filtering' ) array = ndi . laplace ( in_array ) print ( 'Writing' ) outdata . GetRasterBand ( 1 ) . WriteArray ( array ) outdata . GetRasterBand ( 1 ) . SetNoDataValue ( nodata_val ) outdata . FlushCache ( ) outdata = None band = None ds = None print ( 'Laplacian successfully generated' )
short_docstring: Takes a raster and applies a Lapalcian filter to it
short_docstring_tokens: Takes a raster and applies a Lapalcian filter to it
comment: """
      Takes a raster and applies a Lapalcian filter to it
  
      Args:
          in_file: input raster
          out_file: output raster
  
      Returns:
          Nothing
  
      """$SEP$##sets same geotransform as input$SEP$##sets same projection as input$SEP$##if you want these values transparent$SEP$##saves to disk!!