enable shapely speedups

This commit is contained in:
Laura Klünder 2017-10-19 22:33:22 +02:00
parent d2c53e0c3d
commit f1aab8b1e4

View file

@ -3,9 +3,14 @@ from itertools import chain
import matplotlib.pyplot as plt
from matplotlib.patches import PathPatch
from matplotlib.path import Path
from shapely import speedups
from shapely.geometry import LineString, Polygon
if speedups.available:
speedups.enable()
def clean_geometry(geometry):
"""
if the given geometry is a Polygon and invalid, try to make it valid if it results in a Polygon (not MultiPolygon)