jonas-p / go-shp

Go library for reading and writing ESRI Shapefiles. Pure Golang implementation based on the ESRI Shapefile technical description.
MIT License
255 stars 67 forks source link

Why is it challenging to manipulate points when working with zipped shapefiles in Go? #54

Open ez-kraivit opened 1 year ago

ez-kraivit commented 1 year ago
     shape, _ := shp.OpenZip(tmpFile.Name())
     defer shape.Close()
     for shape.Next() {
    _, p := shape.Shape()
    if point, ok := p.(*shp.Polygon); ok {
        fmt.Println(point.Points)
    }
}

Why do I have to write it as p(shp.Polygon)? I want to be able to write p.Points() directly. It seems like I have to spend time understanding the internal structure and designing according to what I need