geopandas.GeoSeries.is_ring¶
- property GeoSeries.is_ring¶
Returns a
Series
ofdtype('bool')
with valueTrue
for features that are closed.When constructing a LinearRing, the sequence of coordinates may be explicitly closed by passing identical values in the first and last indices. Otherwise, the sequence will be implicitly closed by copying the first tuple to the last index.
Examples
>>> from shapely.geometry import LineString, LinearRing >>> s = geopandas.GeoSeries( ... [ ... LineString([(0, 0), (1, 1), (1, -1)]), ... LineString([(0, 0), (1, 1), (1, -1), (0, 0)]), ... LinearRing([(0, 0), (1, 1), (1, -1)]), ... ] ... ) >>> s 0 LINESTRING (0.00000 0.00000, 1.00000 1.00000, ... 1 LINESTRING (0.00000 0.00000, 1.00000 1.00000, ... 2 LINEARRING (0.00000 0.00000, 1.00000 1.00000, ... dtype: geometry
>>> s.is_ring 0 False 1 True 2 True dtype: bool