Пример #1
0
        /// <summary>
        /// Method to insert a new feature to the tree
        /// </summary>
        /// <param name="fid">The feature's id</param>
        /// <param name="geometry">The feature's geometry</param>
        public void Insert(uint fid, GeoAPI.Geometries.IGeometry geometry)
        {
            Interval x, y, z, m;

            GeometryMetricExtensions.GetMetric(geometry, out x, out y, out z, out m);
            Insert(fid, geometry.EnvelopeInternal, z, m);
        }
Пример #2
0
        /// <summary>
        /// Method to get some of the shapefile header values.
        /// </summary>
        /// <param name="geoms">An enumeration of (id, geometry) tuples</param>
        /// <param name="xrange">The x-extent</param>
        /// <param name="yrange">The y-extent</param>
        /// <param name="zrange">The z-extent</param>
        /// <param name="mrange">The m-extent</param>
        private static void GetIntervals(IEnumerable <Tuple <uint, IGeometry> > geoms, out Interval xrange, out Interval yrange,
                                         out Interval zrange, out Interval mrange)
        {
            xrange = Interval.Create();
            yrange = Interval.Create();
            zrange = Interval.Create();
            mrange = Interval.Create();

            foreach (var tuple in geoms)
            {
                Interval x2Range, y2Range, z2Range, m2Range;
                GeometryMetricExtensions.GetMetric(tuple.Item2, out x2Range, out y2Range, out z2Range, out m2Range);
                xrange = xrange.ExpandedByInterval(x2Range);
                yrange = yrange.ExpandedByInterval(y2Range);
                zrange = zrange.ExpandedByInterval(z2Range);
                mrange = mrange.ExpandedByInterval(m2Range);
            }
        }