Toblerity/Shapely — pull request #171 by snorfalorpagus (2014-09-02 21:40:01+00:00)
Title: Fixed regression in 45ee253 by checking GEOSisRing first.

Fixed regression identified by @jwass in PR https://github.com/Toblerity/Shapely/pull/170, where trying to create a LinearRing from a LineString that was not closed would cause a segfault.

The new code does a check to see if the LineString is a ring (GEOSisRing). If it is, the coordinate system is cloned and a LinearRing geometry is created. If it isn't, the function continues and the ring is closed later (https://github.com/snorfalorpagus/Shapely/blob/649fff87fc0740e9e92462feb75a79832bf8a62d/shapely/geometry/polygon.py#L425).

@jwass Could you confirm that this fixes the issue? I used is_ring instead of is_closed. Not sure of the difference, and is_closed wasn't implemented in ctypes whereas is_ring was.