private bool IsTooSmall([NotNull] IRing ring, double xyTolerance) { IPolygon polygon = GeometryFactory.CreatePolygon(ring); GeometryUtils.Simplify(polygon, true, false); if (polygon.IsEmpty) { return(true); } ring.QueryEnvelope(_envelopeTemplate1); double ringWidth = _envelopeTemplate1.Width; double ringHeight = _envelopeTemplate1.Height; polygon.QueryEnvelope(_envelopeTemplate1); double simplifiedWidth = _envelopeTemplate1.Width; double simplifiedHeight = _envelopeTemplate1.Height; double maximumReduction = xyTolerance * 4; return(ringWidth - simplifiedWidth > maximumReduction || ringHeight - simplifiedHeight > maximumReduction); }
private bool IsHorizontal([NotNull] IRing ring) { ring.QueryEnvelope(_envelopeTemplate); return(_envelopeTemplate.Depth <= _horizontalZTolerance); }