GeoCache.Common.Repository.SdeRepository.GetFullExtent C# (CSharp) Method

GetFullExtent() public method

Get full extent of featureClass
public GetFullExtent ( string featureClassName ) : IEnvelope
featureClassName string FeatureClass name
return IEnvelope
        public IEnvelope GetFullExtent(string featureClassName)
        {
            var dataset = (IGeoDataset)this.OpenFeatureClass(featureClassName);
            var extent = dataset.Extent;

            return new Envelope(extent.XMax, extent.XMin, extent.YMax, extent.YMin);
        }

Usage Example

Ejemplo n.º 1
0
        public void TestMethod1()
        {
            int percent = 0;

            var repository = new SdeRepository("srvprodist", "5151", "bdgd", "bdgd", "sde.DEFAULT");
            var cache = new InMemoryCache(repository, repository.GetFullExtent("admgid.Switch_PT"), "admgid.Switch_PT");

            cache.OnProgress += delegate(int i)
                {
                    percent = i;
                };

            cache.BuildAllCache();

            IList<IGeometry> list = new List<IGeometry>();

            var envelop = new Envelope(325017, 320003, 7392018, 7391712);
            IEnvelope affected = null;

            var inicio = DateTime.Now;
            var result = cache.RetriveData(envelop, ref list, ref affected);
            var tempo1 = (DateTime.Now - inicio).TotalMilliseconds;

            inicio = DateTime.Now;
            var fromSde = repository.GetByEnvelope("admgid.Switch_PT", envelop);
            var tempo2 = (DateTime.Now - inicio).TotalMilliseconds;

            Assert.AreEqual(list.Count, fromSde.Count());
            Assert.IsTrue(tempo1 < tempo2);
            Assert.AreEqual(percent, 100);
        }
All Usage Examples Of GeoCache.Common.Repository.SdeRepository::GetFullExtent