Exemple #1
0
        /// <summary>
        /// Saves a spatial index containing features to the cache.
        /// </summary>
        /// <param name="index">Spatial index</param>
        /// <param name="featureType">Type of features in index</param>
        public void SaveFeaturesIndex(ISpatialIndex index, FeatureType featureType)
        {
            List <Feature> features = new List <Feature>();

            lock (_syncRoot)
            {
                index.QueryObjectsInRectangle(index.IndexedSpace, features);

                foreach (Feature s in features)
                {
                    if (s.FeatureType != featureType)
                    {
                        throw new ArgumentException("Illegal feature type", "index");
                    }
                }

                AddOrReplaceIndex((ISpatialIndex)index.Clone(), featureType);
            }
        }
        /// <summary>
        /// Saves a spatial index containing features to the cache.
        /// </summary>
        /// <param name="index">Spatial index</param>
        /// <param name="featureType">Type of features in index</param>
        public void SaveFeaturesIndex(ISpatialIndex index, FeatureType featureType)
        {
            List<Feature> features = new List<Feature>();
            lock (_syncRoot)
            {
                index.QueryObjectsInRectangle(index.IndexedSpace, features);

                foreach (Feature s in features)
                    if (s.FeatureType != featureType)
                        throw new ArgumentException("Illegal feature type", "index");

                AddOrReplaceIndex((ISpatialIndex)index.Clone(), featureType);
            }
        }