GeospatialPython / pyshp

This library reads and writes ESRI Shapefiles in pure Python.
MIT License
1.1k stars 259 forks source link

signed_area error for coordinates with dimensions > 2 #185

Closed clement-tourriere closed 3 years ago

clement-tourriere commented 5 years ago

signed_area method doesn't support shapes with coordinates containing more than 2 dimensions.

A simple fix would be to change ligne 163: https://github.com/GeospatialPython/pyshp/blob/master/shapefile.py#L163

From xs, ys = map(list, zip(*coords)) to xs, ys = map(list, zip(*coords))[0:2]

I can do a PR if you want.

With best regard.

karimbahgat commented 3 years ago

Fixed now, but had to tweak it slightly for py3 support. Just out of curiosity, were you using the signed_area function directly or did it happen as part of some other pyshp function?