Esempio n. 1
0
 public RastersRowEnumerable(
     [NotNull] IEnumerable <RasterReference> rasterReferences,
     [NotNull] ITestProgress progress)
     : this(rasterReferences.ToDictionary(
                r => r,
                r => r.CreateFullRaster()), progress)
 {
 }
 public TerrainRowEnumerable([NotNull] TerrainReference terrainRef,
                             double resolution,
                             [NotNull] ITestProgress progress)
 {
     _terrainReference = terrainRef;
     _resolution       = resolution;
     FirstTerrainBox   = GetFirstTerrainTileExtent(terrainRef);
     _progress         = progress;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TerrainRow"/> class.
        /// </summary>
        /// <param name="box">The box.</param>
        /// <param name="terrainReference">The terrain reference.</param>
        /// <param name="resolution">The resolution.</param>
        /// <param name="testProgress">The test progress reporting instance.</param>
        internal TerrainRow([NotNull] IEnvelope box,
                            [NotNull] TerrainReference terrainReference,
                            double resolution,
                            [NotNull] ITestProgress testProgress)
        {
            Assert.ArgumentNotNull(box, nameof(box));
            Assert.ArgumentNotNull(terrainReference, nameof(terrainReference));
            Assert.ArgumentNotNull(testProgress, nameof(testProgress));

            Extent           = box;
            TerrainReference = terrainReference;
            _resolution      = resolution;

            _testProgress = testProgress;
            DatasetName   = Assert.NotNull(TerrainReference.Name);
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TerrainRow"/> class.
        /// </summary>
        /// <param name="box">The box.</param>
        /// <param name="rasterReference">The dynamic surface.</param>
        /// <param name="raster">= rasterDataset.CreateFullRaster()</param>
        /// <param name="resolution">The resolution.</param>
        /// <param name="testProgress">The test progress reporting instance.</param>
        internal RasterRow([NotNull] IEnvelope box,
                           [NotNull] RasterReference rasterReference,
                           [NotNull] IRaster raster,
                           double resolution,
                           [NotNull] ITestProgress testProgress)
        {
            Assert.ArgumentNotNull(box, nameof(box));
            Assert.ArgumentNotNull(rasterReference, nameof(box));
            Assert.ArgumentNotNull(raster, nameof(raster));
            Assert.ArgumentNotNull(testProgress, nameof(testProgress));

            Extent          = box;
            RasterReference = rasterReference;
            _raster         = raster;

            _testProgress = testProgress;
            DatasetName   = Assert.NotNull(rasterReference.RasterDataset.Name);
        }
Esempio n. 5
0
        public RastersRowEnumerable(
            [NotNull] IDictionary <RasterReference, IRaster> rasters,
            [NotNull] ITestProgress progress)
        {
            Assert.ArgumentNotNull(rasters, nameof(rasters));
            Assert.ArgumentNotNull(progress, nameof(progress));

            _rastersDict = rasters;
            _progress    = progress;

            IEnvelope extent = null;
            var       minDx  = double.MaxValue;

            foreach (var raster in rasters.Values)
            {
                var props = (IRasterProps)raster;
                minDx = Math.Min(props.MeanCellSize().X, minDx);
                if (extent == null)
                {
                    extent = props.Extent.Envelope;
                }
                else
                {
                    extent.Union(props.Extent.Envelope);
                }
            }

            if (extent != null)
            {
                _extent = QaGeometryUtils.CreateBox(extent);
            }

            // TODO: adapt cellsize according to minDx

            MaxRasterPointCount = _defaultMaxRasterPointCount;
        }