Mapsui.Geometries.MultiLineString.Distance C# (CSharp) Method

Distance() public method

Returns the shortest distance between any two points in the two geometries as calculated in the spatial reference system of this Geometry.
public Distance ( Point point ) : double
point Point Geometry to calculate distance to
return double
        public override double Distance(Point point)
        {
            // brute force approach!
            var minDist = double.MaxValue;
            foreach (var ls in LineStrings)
            {
                IList<Point> coord0 = ls.Vertices;
                for (var i = 0; i < coord0.Count - 1; i++)
                {
                    var dist = CGAlgorithms.DistancePointLine(point, coord0[i], coord0[i + 1]);
                    if (dist < minDist)
                        minDist = dist;
                }
            }
            return minDist;
        }