Fix missing imports

LinearRing, LineString, Polygon were never imported.
Also clean useless imports from random module.