fix typos

This commit is contained in:
jan 2017-09-08 10:30:56 -07:00
parent 01395134ee
commit f4b8f513d4

View File

@ -186,7 +186,7 @@ class Polygon(Shape):
:return: List of Polygon objects :return: List of Polygon objects
""" """
import float_raster import float_raster
xy_complex = self.vertices[:, 1] + 1j * self.vertices[:, 2] xy_complex = self.vertices[:, 0] + 1j * self.vertices[:, 1]
xy_cleaned = _clean_complex_vertices(xy_complex) xy_cleaned = _clean_complex_vertices(xy_complex)
xy = numpy.vstack((numpy.real(xy_cleaned)[None, :], xy = numpy.vstack((numpy.real(xy_cleaned)[None, :],
numpy.imag(xy_cleaned)[None, :])) numpy.imag(xy_cleaned)[None, :]))
@ -226,7 +226,7 @@ class Polygon(Shape):
def _clean_complex_vertices(vertices: numpy.ndarray) -> numpy.ndarray: def _clean_complex_vertices(vertices: numpy.ndarray) -> numpy.ndarray:
eps = numpy.finfo(vertices.dtype).eps eps = numpy.finfo(vertices.dtype).eps
def cleanup(vertices): def cleanup(v):
# Remove duplicate points # Remove duplicate points
dv = v - numpy.roll(v, 1) dv = v - numpy.roll(v, 1)
v = v[numpy.abs(dv) > eps] v = v[numpy.abs(dv) > eps]