# HG changeset patch # User Sascha L. Teichmann # Date 1536913086 -7200 # Node ID ce18231825a262129a0d2b7e5708dba814830414 # Parent 2745ac1ebe1e556a9252d57ddca734189d623750 Cross sections: Small details on Equals Method of GeoJSONCoordinateZ (forget to commit). diff -r 2745ac1ebe1e -r ce18231825a2 pkg/models/cross.go --- a/pkg/models/cross.go Thu Sep 13 16:56:11 2018 +0200 +++ b/pkg/models/cross.go Fri Sep 14 10:18:06 2018 +0200 @@ -216,12 +216,12 @@ return nil } -func (cz GeoJSONCoordinateZ) equals(other GeoJSONCoordinateZ) bool { +func (cz GeoJSONCoordinateZ) Equals(other GeoJSONCoordinateZ) bool { const ( xyEps = 1e-7 zEps = 1e-5 ) - return math.Abs(cz.Lat-other.Lat) < 0.000000001 && + return math.Abs(cz.Lat-other.Lat) < xyEps && math.Abs(cz.Lon-other.Lon) < xyEps && math.Abs(cz.Z-other.Z) < zEps } @@ -256,7 +256,7 @@ } curr := lists[i] head := curr[0] - if tail.equals(head) { + if tail.Equals(head) { n := make(GeoJSONLineCoordinatesZ, len(front)+len(curr)-1) copy(n, front[:len(front)-1]) n[len(front)-1] = head.mid(tail)