public void UpdateLayer(Feature fet) { if (fet != null) { ILabelLayer lyr = GetLabelLayer(_layerName, new string[] { _fieldName }); if (lyr != null) { ApplyColor(lyr); lyr.LabelDef.Fieldname = _fieldName; lyr.LabelDef.EnableLabeling = true; lyr.AddFeature(fet); AddFeatureToListView(fet); } } }
public void UpdateLayer(ref Feature fet) { if (fet != null) { ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), _layerName, fet.FieldNames); if (lyr != null) { ApplyColor(lyr); lyr.LabelDef.Fieldname = fet.FieldNames[0]; lyr.LabelDef.EnableLabeling = true; lyr.AddFeature(fet); Feature[] features = lyr.GetAllFeature(); fet = features[features.Length - 1]; AddFeatureToListView(fet); } } }
private void StatFilterAreas() { ICurrentRasterInteractiver inter = _session.SmartWindowManager.ActiveCanvasViewer as ICurrentRasterInteractiver; if (inter != null) { inter.StartAOIDrawing(GetPencilType(), (aoi, shape) => { string layerName = "System:StatArea"; ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), layerName, _fieldNames); if (lyr != null) { Dictionary <string, double> areas = StatArea(aoi, _filters); _layerName = layerName; //ApplyColor(lyr); //lyr.LabelDef.Fieldname = "面积(平方公里)"; ApplyColor(lyr); lyr.LabelDef.Fieldname = _fieldNames[1]; lyr.LabelDef.EnableLabeling = true; CodeCell.AgileMap.Core.Feature fet = null; try { fet = ToFeature(shape, areas.Values.ToArray()); } catch (Exception ex) { _session.PrintMessage(ex); } if (fet != null) { lyr.AddFeature(fet); AddFeatureToListView(fet); } } }); } }
private void SataSimpleArea() { string[] lstViewfieldNames = new string[] { "名称", "像元个数", "面积(平方公里)" }; string[] fieldNames = new string[] { "name", "pixelcount", "area" }; UpdateHeadersOfListView(lstViewfieldNames); ICurrentRasterInteractiver inter = _activeViewer as ICurrentRasterInteractiver; if (inter != null) { //inter inter.StartAOIDrawing(GetPencilType(), (aoi, shape) => { string layerName = "System:StatArea"; ILabelLayer lyr = GetLabelLayer((_activeViewer as ICurrentRasterInteractiver), layerName, fieldNames); if (lyr != null) { _layerName = layerName; ApplyColor(lyr); lyr.LabelDef.Fieldname = "area"; CodeCell.AgileMap.Core.Feature fet = null; try { fet = ToFeature(aoi, shape, fieldNames); } catch (Exception ex) { _session.PrintMessage(ex); } if (fet != null) { lyr.AddFeature(fet); AddFeatureToListView(fet); } } }); } }