Mercurial > gemma
changeset 651:ce18231825a2
Cross sections: Small details on Equals Method of GeoJSONCoordinateZ (forget to commit).
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 14 Sep 2018 10:18:06 +0200 |
parents | 2745ac1ebe1e |
children | f5ecd1d72a6e |
files | pkg/models/cross.go |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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)