# HG changeset patch # User Sascha L. Teichmann # Date 1537366149 -7200 # Node ID bd215c4325ce6cc2d422926fd2b00d487942c2f8 # Parent 3e2eeb215d0e5ec11f66ab523493bdbca1a2b3fa Cross sections: Only join point in x/y plane. diff -r 3e2eeb215d0e -r bd215c4325ce pkg/models/cross.go --- a/pkg/models/cross.go Tue Sep 18 18:23:15 2018 +0200 +++ b/pkg/models/cross.go Wed Sep 19 16:09:09 2018 +0200 @@ -260,15 +260,16 @@ return math.Sqrt(dLat*dLat+x*x) * EarthRadius } -func (cz GeoJSONCoordinateZ) quant() GeoJSONCoordinateZ { - const ( - xyScale = 1e6 - zScale = 1e5 - ) - return GeoJSONCoordinateZ{ - Lon: math.Round(cz.Lon*xyScale) / xyScale, - Lat: math.Round(cz.Lat*xyScale) / xyScale, - Z: math.Round(cz.Z*zScale) / zScale, +type point struct { + x float64 + y float64 +} + +func (cz GeoJSONCoordinateZ) quant() point { + const xyScale = 1e6 + return point{ + math.Round(cz.Lon*xyScale) / xyScale, + math.Round(cz.Lat*xyScale) / xyScale, } } @@ -292,7 +293,7 @@ order int } - heads := make(map[GeoJSONCoordinateZ]*value) + heads := make(map[point]*value) for i, coords := range ml { key := coords[len(coords)-1].quant()