I’m using shapely in Python (3.6) running afffinity.transform many times where I expect intersections. Now, the “Self-intersection at or near point x y” warning is filling up my console unnecessarily. I tried blocking printing (which only stopped my print statements and not Shapely’s) and suppressing warnings (both snippets below) with no luck. Is there any way to stop Shapely from printing warnings to the console?
# Stop all printing def blockPrint(): sys.stdout = open(os.devnull, ‘w’); # Re-enable printing def enablePrint(): sys.stdout = sys.__stdout__; with warnings.catch_warnings(): warnings.simplefilter(“ignore”) blockPrint() p_i = shapely.affinity.translate(p_i, xoff=0, yoff=-2, zoff=0.0) enablePrint()