private void InitCategories(Dictionary <string, string> fileDirList) { treeView1.Nodes.Clear(); // foreach (string keyItem in fileDirList.Keys) { string shpFileName = VectorAOITemplate.FindVectorFullname(fileDirList[keyItem]); if (!string.IsNullOrEmpty(shpFileName)) { VectorTempFeatureCategory categoryItem = new VectorTempFeatureCategory(keyItem, shpFileName); _categories.Add(categoryItem); } else { VectorTempFeatureCategory categoryItem = new VectorTempFeatureCategory(keyItem); _categories.Add(categoryItem); } } LoadCustomRegionFiles(); // foreach (VectorTempFeatureCategory c in _categories) { TreeNode tn = new TreeNode(c.Name); tn.Tag = c; treeView1.Nodes.Add(tn); } treeView1.ExpandAll(); // treeView1.SelectedNode = treeView1.Nodes[0]; }
private StatResultItem[] ApplyStatByVectorTemplate(IRasterDataProvider raster, string shpTemplateName, string primaryFieldName, Func <T, int, int> weight) { string shpFullname = VectorAOITemplate.FindVectorFullname(shpTemplateName); IAOITemplateStat <T> stat = new AOITemplateStat <T>(); return(ResultsWithoutZero(stat.CountByVector(raster, shpFullname, primaryFieldName, weight))); }
private void InitCategories() { treeView1.Nodes.Clear(); // VectorTempFeatureCategory wholeCategory = new VectorTempFeatureCategory("当前区域"); _categories.Add(wholeCategory); // VectorTempFeatureCategory chinaCategory = new VectorTempFeatureCategory("中国边界", VectorAOITemplate.FindVectorFullname("中国边界.shp")); _categories.Add(chinaCategory); // VectorTempFeatureCategory chinaAdminsCategory = new VectorTempFeatureCategory("省级行政区域", VectorAOITemplate.FindVectorFullname("省级行政区域_面.shp")); _categories.Add(chinaAdminsCategory); // VectorTempFeatureCategory cityCategory = new VectorTempFeatureCategory("地区行政区域", VectorAOITemplate.FindVectorFullname("市级行政区域_面.shp")); _categories.Add(cityCategory); // VectorTempFeatureCategory countryCategory = new VectorTempFeatureCategory("县市行政区域", VectorAOITemplate.FindVectorFullname("县级行政区域_面.shp")); _categories.Add(countryCategory); //// //VectorTempFeatureCategory landUseTypeCategory = new VectorTempFeatureCategory("土地利用类型", VectorAOITemplate.FindVectorFullname("土地利用类型_合并.shp")); //_categories.Add(landUseTypeCategory); //// VectorTempFeatureCategory waterBackCategory = new VectorTempFeatureCategory("湖泊", VectorAOITemplate.FindVectorFullname("中国湖泊.shp")); _categories.Add(waterBackCategory); LoadCustomRegionFiles(); // foreach (VectorTempFeatureCategory c in _categories) { TreeNode tn = new TreeNode(c.Name); tn.Tag = c; treeView1.Nodes.Add(tn); } treeView1.ExpandAll(); // treeView1.SelectedNode = treeView1.Nodes[0]; }
private byte[] GetLanduseTypeRaster(IRasterDataProvider dataProvider, Size size, out string[] landuseTypes, string vectorTemplate) { VectorAOITemplate temp = VectorAOITemplateFactory.GetAOITemplate(vectorTemplate); return(temp.GetRaster(GetEnvelope(dataProvider), size, "NAME", out landuseTypes)); }
public static VectorAOITemplate GetAOITemplate(string name) { switch (name) { case "太湖": return(new VectorAOITemplate("太湖水体边界.shp", true)); case "太湖无水草": return(new VectorAOITemplate("太湖无水草边界.shp", true)); case "巢湖": return(new VectorAOITemplate("巢湖水体边界.shp", true)); case "滇池": return(new VectorAOITemplate("滇池水体边界.shp", true)); case "鄱阳湖": return(new VectorAOITemplate("鄱阳湖水体边界.shp", true)); case "洞庭湖": return(new VectorAOITemplate("洞庭湖水体边界.shp", true)); case "海陆模版": return(new VectorAOITemplate("海陆模版.shp", true)); case "海陆模版_反": VectorAOITemplate t = new VectorAOITemplate("海陆模版.shp", true); t.IsReverse = true; return(t); case "贝尔湖": return(new VectorAOITemplate("中国湖泊.shp", (fet) => { return fet.GetFieldValue("name") == "贝尔湖"; } )); case "呼伦湖": return(new VectorAOITemplate("中国湖泊.shp", (fet) => { return fet.GetFieldValue("name") == "呼伦湖"; } )); case "省级行政区": return(new VectorAOITemplate("省级行政区域_面.shp")); case "土地利用类型": return(new VectorAOITemplate("土地利用类型_合并.shp")); case "丹江口水库": return(new VectorAOITemplate("丹江口水库_P.shp")); case "官厅水库": return(new VectorAOITemplate("官厅水库_P.shp")); case "密云水库": return(new VectorAOITemplate("密云水库_P.shp")); case "郊区农田": return(new VectorAOITemplate("郊区农田_P.shp")); case "洞庭分区": return(new VectorAOITemplate("洞庭分区.shp")); case "纳木错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "纳木错"; } )); case "色林错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "色林错"; } )); case "羊卓雍错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "羊卓雍错"; } )); case "普莫雍错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "普莫雍错"; } )); case "当惹雍错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "当惹雍错"; } )); case "扎日南木错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "扎日南木错"; } )); case "佩枯错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "佩枯错"; } )); case "塔若错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "塔若错"; } )); case "玛旁雍错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "玛旁雍错"; } )); case "拉昂错": return(new VectorAOITemplate("西藏常用湖泊区域.shp", (fet) => { return fet.GetFieldValue("name") == "拉昂错"; } )); case "西藏常用湖泊": return(new VectorAOITemplate("西藏常用湖泊区域.shp")); default: return(null); } }
private byte[] GetAdminTypeRaster(IRasterDataProvider dataProvider, Size size, out string[] adminNames) { VectorAOITemplate temp = VectorAOITemplateFactory.GetAOITemplate("省级行政区"); return(temp.GetRaster(GetEnvelope(dataProvider), size, "NAME", out adminNames)); }