A GeoSerie is a list of shapely geometries, therefore
with shapely
from shapely.geometry import LineString, shape line_new = LineString([(0.3, 0.6), (1.5, 1.6), (0.9,2.5)]) type(shape(line_new)) <class 'shapely.geometry.linestring.LineString'> list(shape(line_new).coords) [(0.3, 0.6), (1.5, 1.6), (0.9, 2.5)]
from shapely.geometry import LineString, shape line_new = LineString([(0.3, 0.6), (1.5, 1.6), (0.9,2.5)]) type(shape(line_new)) <class 'shapely.geometry.linestring.LineString'> list(shape(line_new).coords) [(0.3, 0.6), (1.5, 1.6), (0.9, 2.5)]
with your GeoDataFrame (list of shapely geometries)
type(df.geometry) <class 'geopandas.geoseries.GeoSeries'> df['geometry'].coords .... AttributeError: 'GeoSeries' object has no attribute 'coords'
type(df.geometry) <class 'geopandas.geoseries.GeoSeries'> df['geometry'].coords .... AttributeError: 'GeoSeries' object has no attribute 'coords'
First row of the GeoSerie = first shapely geometry
type(df.geometry.iloc[0])
<class 'shapely.geometry.linestring.LineString'>
list(df.geometry.iloc[0].coords)
[(0.3, 0.6), (1.5, 1.6), (0.9, 2.5)]
type(df.geometry.iloc[0])
<class 'shapely.geometry.linestring.LineString'>
list(df.geometry.iloc[0].coords)
[(0.3, 0.6), (1.5, 1.6), (0.9, 2.5)]