Пример #1
0
        /// <summary>
        /// Create the envelope
        /// </summary>
        /// <returns></returns>
        private IEnvelope CreateEnvelope()
        {
            var maxX = this.Vertices.Select(x => x.X).Max();
            var maxY = this.Vertices.Select(x => x.Y).Max();

            var minX = this.Vertices.Select(x => x.X).Min();
            var minY = this.Vertices.Select(x => x.Y).Min();

            var envelope = new Envelope(maxX, maxY, minX, minY);

            return envelope;
        }
Пример #2
0
        /// <summary>
        /// Create the envelope
        /// </summary>
        /// <returns></returns>
        private IEnvelope CreateEnvelope()
        {
            var points = new List<IMapPoint>();

            foreach (var linearRing in Rings)
            {
                points.AddRange(linearRing.Vertices);
            }

            var maxX = points.Select(x => x.X).Max();
            var maxY = points.Select(x => x.Y).Max();

            var minX = points.Select(x => x.X).Min();
            var minY = points.Select(x => x.Y).Min();

            var envelope = new Envelope(maxX, maxY, minX, minY);

            return envelope;
        }