Mercurial > gemma
diff pkg/octree/tin.go @ 1692:f4dcbe8941a1
Octree: Resolved the remaing golint issues with this package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 31 Dec 2018 11:13:49 +0100 |
parents | de09bd3b5c05 |
children | 63475c8e710e |
line wrap: on
line diff
--- a/pkg/octree/tin.go Sun Dec 30 16:24:51 2018 +0100 +++ b/pkg/octree/tin.go Mon Dec 31 11:13:49 2018 +0100 @@ -32,15 +32,24 @@ errTooLessPoints = errors.New("Too less points") ) +// Tin stores a mesh of triangles with common vertices. type Tin struct { - EPSG uint32 - Vertices []Vertex + // EPSG holds the projection. + EPSG uint32 + // Vertices are the shared vertices. + Vertices []Vertex + // Triangles are the triangles. Triangles [][]int32 + // Min is the lower left corner of the bbox. Min Vertex + // Max is the upper right corner of the bbox. Max Vertex } +// FromWKB constructs the TIN from a WKB representation. +// Shared vertices are identified and referenced by the +// same index. func (t *Tin) FromWKB(data []byte) error { log.Printf("info: data length %d\n", len(data)) @@ -201,6 +210,8 @@ loadTinByIDSQL = tinSQLPrefix + `WHERE id = $2` + tinSQLSuffix ) +// GenerateTinByID generated a TIN by triangulating a point cloud +// from the database. func GenerateTinByID( ctx context.Context, conn *sql.Conn, @@ -219,6 +230,7 @@ return &tin, nil } +// Scan implements the sql.Scanner interface. func (t *Tin) Scan(raw interface{}) error { if raw == nil { return nil