diff pkg/imports/polygon.go @ 1496:3bf1f0de0763

Un-export point, line string and polygon types in import package as these are only used locally.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 04 Dec 2018 18:27:35 +0100
parents a244b18cb916
children a3a3fc630620
line wrap: on
line diff
--- a/pkg/imports/polygon.go	Tue Dec 04 18:20:31 2018 +0100
+++ b/pkg/imports/polygon.go	Tue Dec 04 18:27:35 2018 +0100
@@ -23,12 +23,12 @@
 )
 
 type (
-	Point struct {
+	point struct {
 		X float64
 		Y float64
 	}
-	LineString []Point
-	Polygon    []LineString
+	lineString []point
+	polygon    []lineString
 )
 
 const (
@@ -36,7 +36,7 @@
 	wkbPolygon uint32 = 3
 )
 
-func shapeToPolygon(s shp.Shape) (Polygon, error) {
+func shapeToPolygon(s shp.Shape) (polygon, error) {
 	switch p := s.(type) {
 	case *shp.Polygon:
 		return toPolygon(p.NumParts, p.Parts, p.Points), nil
@@ -48,22 +48,22 @@
 	return nil, fmt.Errorf("Unsupported shape type %T", s)
 }
 
-func toPolygon(numParts int32, parts []int32, points []shp.Point) Polygon {
-	out := make(Polygon, numParts)
+func toPolygon(numParts int32, parts []int32, points []shp.Point) polygon {
+	out := make(polygon, numParts)
 	pos := 0
 	for i := range out {
 		ps := parts[i]
-		line := make(LineString, ps)
+		line := make(lineString, ps)
 		for j := int32(0); j < ps; j, pos = j+1, pos+1 {
 			p := &points[pos]
-			line[j] = Point{p.X, p.Y}
+			line[j] = point{p.X, p.Y}
 		}
 		out[i] = line
 	}
 	return out
 }
 
-func (p Polygon) AsWBK() []byte {
+func (p polygon) asWKB() []byte {
 	if p == nil {
 		return nil
 	}