Skip to main content
2 of 3
added 179 characters in body
Taras
  • 34k
  • 4
  • 73
  • 148

You can also get your points simply via points:

The points attribute contains a list of tuples containing an (x,y) coordinate for each point in the shape.

import shapefile

shape = shapefile.Reader("C:/TempData/test/grids.shp")

feature = shape.shapeRecords()[0]

points = feature.shape.points
print(points)

That results in

[(413795.5781, 5655831.7174), (413895.5781, 5655831.7174), (413895.5781, 5655731.7174), (413795.5781, 5655731.7174), (413795.5781, 5655831.7174)] 

Also with this method one can refer to a specific point of a feature:

point2 = feature.shape.points[2] # vertex #2
print(point2)
Taras
  • 34k
  • 4
  • 73
  • 148