Skip to content

Commit 3832112

Browse files
committed
Require geojType to be equal to string literals, not substrings
1 parent f23a08c commit 3832112

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

shapefile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def __geo_interface__(self) -> GeoJSONT:
604604
)
605605

606606
@staticmethod
607-
def _from_geojson(geoj):
607+
def _from_geojson(geoj) -> Shape:
608608
# create empty shape
609609
shape = Shape()
610610
# set shapeType
@@ -634,7 +634,7 @@ def _from_geojson(geoj):
634634
elif geojType in ("MultiPoint", "LineString"):
635635
shape.points = geoj["coordinates"]
636636
shape.parts = [0]
637-
elif geojType in ("Polygon"):
637+
elif geojType in ("Polygon",):
638638
points = []
639639
parts = []
640640
index = 0
@@ -653,7 +653,7 @@ def _from_geojson(geoj):
653653
index += len(ext_or_hole)
654654
shape.points = points
655655
shape.parts = parts
656-
elif geojType in ("MultiLineString"):
656+
elif geojType in ("MultiLineString",):
657657
points = []
658658
parts = []
659659
index = 0
@@ -663,7 +663,7 @@ def _from_geojson(geoj):
663663
index += len(linestring)
664664
shape.points = points
665665
shape.parts = parts
666-
elif geojType in ("MultiPolygon"):
666+
elif geojType in ("MultiPolygon",):
667667
points = []
668668
parts = []
669669
index = 0

0 commit comments

Comments
 (0)