From 5eb99ea0e091fcccbfc964cafecb4f48c9d8a203 Mon Sep 17 00:00:00 2001 From: thiago Date: Thu, 6 Jul 2017 13:36:17 -0300 Subject: [PATCH] fix __geo_interface__ if parts or points is empty list --- shapefile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shapefile.py b/shapefile.py index 6e4674e..c0b30f3 100644 --- a/shapefile.py +++ b/shapefile.py @@ -201,6 +201,11 @@ def __init__(self, shapeType=NULL, points=None, parts=None, partTypes=None): @property def __geo_interface__(self): + + """ Case parts or points is empty """ + if not self.parts or not self.points: + return False + if self.shapeType in [POINT, POINTM, POINTZ]: return { 'type': 'Point',