3

Given a shapely.geometry.linestring: How do you access single vertices using Python?

6

From Shapely User Manual:

The defining coordinate values are accessed via the coords property.

from shapely.geometry import LineString
line = LineString([(0, 0), (1, 1)])
for coord in line.coords:
    print(coord)

(0.0, 0.0)
(1.0, 1.0)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.