Fix PointSequence.__init__() when passed no points
This commit is contained in:
parent
559c1caa7b
commit
8cdf97164c
1 changed files with 7 additions and 6 deletions
|
@ -27,13 +27,14 @@ class PointSequence(list):
|
||||||
|
|
||||||
self.poly = None
|
self.poly = None
|
||||||
|
|
||||||
for point in points:
|
if points is not None:
|
||||||
typeof = type(point)
|
for point in points:
|
||||||
|
typeof = type(point)
|
||||||
|
|
||||||
if typeof is tuple:
|
if typeof is tuple:
|
||||||
self.add(*point)
|
self.add(*point)
|
||||||
elif typeof is shapely.Point:
|
elif typeof is shapely.Point:
|
||||||
self.append(point)
|
self.append(point)
|
||||||
|
|
||||||
def add(self, lon: float, lat: float):
|
def add(self, lon: float, lat: float):
|
||||||
self.append(shapely.Point(lon, lat))
|
self.append(shapely.Point(lon, lat))
|
||||||
|
|
Loading…
Add table
Reference in a new issue