oggm.global_tasks.write_centerlines_to_shape#
- oggm.global_tasks.write_centerlines_to_shape(gdirs, *, path=True, to_tar=False, to_crs='EPSG:4326', filesuffix='', flowlines_output=False, ensure_exterior_match=False, geometrical_widths_output=False, corrected_widths_output=False, keep_main_only=False, simplify_line_before=0, corner_cutting=0, simplify_line_after=0)[source]#
Write the centerlines to a shapefile.
- Parameters:
- gdirs:
the list of GlacierDir to process.
- path: str or bool
Set to “True” in order to store the shape in the working directory Set to a str path to store the file to your chosen location
- to_tarbool
put the files in a .tar file. If cfg.PARAMS[‘use_compression’], also compress to .gz
- filesuffixstr
add a suffix to the output file
- flowlines_outputbool
output the OGGM flowlines instead of the centerlines
- geometrical_widths_outputbool
output the geometrical widths instead of the centerlines
- corrected_widths_outputbool
output the corrected widths instead of the centerlines
- ensure_exterior_matchbool
per design, the centerlines will match the underlying DEM grid. This may imply that they do not “touch” the exterior outlines of the glacier in vector space. Set this to True to correct for that.
- to_crsstr
write the shape to another coordinate reference system (CRS)
- keep_main_onlybool
write only the main flowlines to the output files
- simplify_line_beforefloat
apply shapely’s simplify method to the line before corner cutting. It is a cosmetic option: it avoids hard “angles” in the centerlines. All points in the simplified object will be within the tolerance distance of the original geometry (units: grid points). A good value to test first is 0.75
- corner_cuttingint
apply the Chaikin’s corner cutting algorithm to the geometry before writing. The integer represents the number of refinements to apply. A good first value to test is 3.
- simplify_line_afterfloat
apply shapely’s simplify method to the line after corner cutting. This is to reduce the size of the geometeries after they have been smoothed. The default value of 0 is fine if you use corner cutting less than 4. Otherwize try a small number, like 0.05 or 0.1.