Пример #1
0
        private RoadNetwork GetRoadNetwork(string wsPath, string dsName)
        {
            RoadNetwork network = new RoadNetwork();

            network.Initialize(wsPath, dsName);
            return(network);
        }
Пример #2
0
        internal bool Setup(Earthquake quake, string facilityData, string incidentData)
        {
            string networkWorkspace = System.IO.Path.Combine(Application.StartupPath,
                                                             @"AnalystData\road");// @"F:\17\private\Disaster\Data\road";
            string networkClassName = "road_ND";

#if DEBUG
            networkClassName = "road_two_regions_ND";
#endif

            string analystDataPath = System.IO.Path.Combine(Application.StartupPath,
                                                            "AnalystData");// @"F:\17\private\Disaster\Data\EarthquakeData";
            string regionClassName = "地区系数";
            string seasonClassName = "季节系数";

            Earthquake = quake;
            if (!SetupOutputDirectory())
            {
                System.Windows.Forms.MessageBox.Show("初始化输出目录失败");
                return(false);
            }
            IFeatureWorkspace ws = WorkspaceUtil.OpenShapeWorkspace(analystDataPath);

            _region = GetRegionCoefficient(ws, regionClassName);
            _season = GetSeasonCoefficient(ws, seasonClassName);

            _incidentWorkspace = System.IO.Path.GetDirectoryName(incidentData);
            _incidentClassName = System.IO.Path.GetFileNameWithoutExtension(incidentData);
            ws = WorkspaceUtil.OpenShapeWorkspace(_incidentWorkspace);
            _siteFeatureClass = ws.OpenFeatureClass(_incidentClassName);

            // _refugeSiteCol = GetRefugeeSiteCol(ws, _incidentClassName);

            _repoWorkspace     = System.IO.Path.GetDirectoryName(facilityData);
            _facilityClassName = System.IO.Path.GetFileNameWithoutExtension(facilityData);
            ws = WorkspaceUtil.OpenShapeWorkspace(_repoWorkspace);
            _repoFeatureClass = ws.OpenFeatureClass(_facilityClassName);

            // _repositoryCol = GetRepositoryCol(ws, _facilityClassName);

            _roadNetwork = GetRoadNetwork(networkWorkspace, networkClassName);
            // _supplyNetwork = GetSupplyNetwork();

            return(true);
        }
 internal void SetLocations(RefugeeSiteCol _refugeSiteCol, RepositoryCol _repositoryCol, RoadNetwork _roadNetwork)
 {
     this._refugeSiteCol = _refugeSiteCol;
     this._repositoryCol = _repositoryCol;
     this._roadNetwork   = _roadNetwork;
 }