Closed rustyoz closed 8 years ago
All points are stored in the instance variable Points, so you'll have to iterate through that.
Read more here http://godoc.org/github.com/jonas-p/go-shp#PolyLine
There's also a test that does exactly this
func test_PolyLine(t *testing.T, filename string, points [][]float64, shapes_num int) {
shapes := getShapes(filename, t)
if len(shapes) != shapes_num {
t.Error("Number of shapes read was wrong.")
}
for n, s := range shapes {
p, ok := s.(*PolyLine)
if !ok {
t.Fatal("Failed to type assert.")
}
for k, point := range p.Points {
if !pointsEqual(points[n*3+k], []float64{point.X, point.Y}) {
t.Error("Points did not match.")
}
}
}
}
similar to this:
i would like to read each point of the resulting polyline