satproc.postprocess namespace

Submodules

satproc.postprocess.generalize module

satproc.postprocess.generalize.generalize(*, input_files, output_dir, target_crs=None, simplify='douglas', douglas_tolerance=0.1, smooth=None, chaikins_refinements=5)[source]
satproc.postprocess.generalize.smooth_chaikin(shp, refinements=5)[source]

satproc.postprocess.polygonize module

satproc.postprocess.polygonize.apply_threshold(src, dst, value=None, *, threshold)[source]

Output source values (probabilities) instead of simply a binary mask

Make sure nodata=0, so that gdal_polygonize step ignores pixels under threshold.

Parameters
  • src (str) – path to input raster

  • dst (str) – path to output raster

  • threshold (int) – threshold value

  • value (int) – value to use on raster output when values are over threshold if None, use the original value from src

satproc.postprocess.polygonize.gdal_polygonize(src, dst)[source]
satproc.postprocess.polygonize.merge_vector_files(*, input_dir, output, tmpdir)[source]
satproc.postprocess.polygonize.polygonize(threshold=None, value=None, temp_dir=None, input_files=[], input_dir=None, tile_size=None, *, output)[source]
satproc.postprocess.polygonize.process_image(image, value=None, *, tmpdir, threshold)[source]
satproc.postprocess.polygonize.retile(raster, output_dir, tile_size)[source]
satproc.postprocess.polygonize.retile_all(input_files, tile_size, temp_dir)[source]

satproc.postprocess.smooth module

satproc.postprocess.smooth.build_bounds_index(image_files)[source]

Returns bounds of merged images and builds an R-Tree index

satproc.postprocess.smooth.generate_spline_window_chips(*, image_paths, output_dir, power=2)[source]

Interpolates all images using a squared spline window

satproc.postprocess.smooth.merge_chips(images_files, *, win_bounds)[source]

Merge by taking mean between overlapping images

satproc.postprocess.smooth.sliding_windows(size, whole=False, step_size=None, *, width, height)[source]

Slide a window of +size+ by moving it +step_size+ pixels

satproc.postprocess.smooth.smooth_stitch(*, input_dir, output_dir, power=1.5, temp_dir=None)[source]

Takes input directory of overlapping chips, and generates a new directory of non-overlapping chips with smooth edges.

satproc.postprocess.smooth.spline_window(window_size, power=2)[source]

Squared spline window function: https://www.wolframalpha.com/input/?i=y%3Dx**2,+y%3D-(x-2)**2+%2B2,+y%3D(x-4)**2,+from+y+%3D+0+to+2

satproc.postprocess.smooth.window_2D(size, power=2, n_channels=1)[source]

satproc.postprocess.spatial_filter module

satproc.postprocess.spatial_filter.spatial_filter(*, input_paths, output_path, mode='gaussian', size=5, merge=True)[source]