Ejemplo n.º 1
0
        public FY3HDFL2ProductProvider(string fileName, byte[] header1024, IGeoDataDriver driver, params object[] args)
            : base(fileName, driver)
        {
            L2ProductDefind[] l2Pros = L2ProductDefindParser.GetL2ProductDefs(Path.GetFileName(_fileName));
            if (l2Pros == null)
            {
                return;
            }
            _fileName = fileName;
            _args     = args;
            L2ProductDefind verifyL2Pro = l2Pros.Length == 1 ? l2Pros[0] : VerifyL2ProDef(l2Pros);

            if (verifyL2Pro == null)
            {
                return;
            }
            using (Dataset dataset = Gdal.Open(fileName, Access.GA_ReadOnly))
            {
                GDALHelper.GetDatasetAttributes(dataset, _attributes);
            }
            Dictionary <string, string> allGdalSubDatasets = this.Attributes.GetAttributeDomain("SUBDATASETS");

            _allGdalSubDatasets = RecordAllSubDatasetNames(allGdalSubDatasets);
            _coordEnvelope      = TrySetGeoInfo(verifyL2Pro);
            _selectedsets       = TryGetSelectedSets(verifyL2Pro);
            TryCreateBandProvider();
            _bandCount   = _rasterBands.Count;
            _dataType    = _rasterBands[0].DataType;
            _width       = _rasterBands[0].Width;
            _height      = _rasterBands[0].Height;
            _coordType   = _spatialRef.ProjectionCoordSystem != null ? enumCoordType.PrjCoord : enumCoordType.GeoCoord;
            _resolutionX = (float)(_coordEnvelope.Width / (_width));
            _resolutionY = (float)(_coordEnvelope.Height / (_height));
            if (_dataIdentify != null && _dataIdentify.OrbitDateTime == DateTime.MinValue)
            {
                _dataIdentify.OrbitDateTime = IceConDataProvider.TryGetFileDate(Path.GetFileName(fileName));
            }
        }
Ejemplo n.º 2
0
 public FYSnowPrdDataProvider(string fileName, byte[] header1024, IGeoDataDriver driver, params object[] args)
     : base(fileName, driver)
 {
     _args = args;
     TryParseArgs();
     using (Dataset dataset = Gdal.Open(fileName, Access.GA_ReadOnly))
     {
         GDALHelper.GetDatasetAttributes(dataset, _attributes);
     }
     TryCreateBandProvider();
     _bandCount = _rasterBands.Count;
     TryGetDatTypeOfProvider();
     TryGetSizeOfProvider();
     //TryCreateSpatialRef();
     _coordType   = enumCoordType.PrjCoord;
     _resolutionX = (float)(_coordEnvelope.Width / (_width));
     _resolutionY = (float)(_coordEnvelope.Height / (_height));
     if (_dataIdentify != null)
     {
         _dataIdentify.Sensor        = "MWRI";
         _dataIdentify.OrbitDateTime = IceConDataProvider.TryGetFileDate(Path.GetFileName(fileName));
     }
 }