/// <summary> /// jzd保存进入map /// </summary> /// <param name="jzd"></param> public static void SaveMap(IList <JZD> jzds) { IFeatureClass featureClass = GetJZDLayer().FeatureClass; Dictionary <int, Clazz> dic = ArcGisService.GetTitleClzz <JZD>(featureClass.Fields, false); dic.Remove(-1); IFeatureCursor featureCursor = featureClass.Insert(true); IFeatureBuffer featureBuffer = featureClass.CreateFeatureBuffer(); foreach (JZD jzd in jzds) { if (jzd.Point == null) { featureBuffer.Shape = jzd.Feature.ShapeCopy; } else { IPoint point = new PointClass(); point.PutCoords(jzd.Point.X, jzd.Point.Y); featureBuffer.Shape = point; } SetFeatureBufferValue(featureBuffer, dic, jzd); featureCursor.InsertFeature(featureBuffer); } }
public static IList <JZD> FeatureToList(IList <IFeature> features) { if (Utils.CheckListExists(features)) { return(ArcGisService.ObjToFeature <JZD>(features, ArcGisService.GetTitleClzz <JZD>(features[0].Fields))); } else { return(null); } }
public static void AddJzdFeature(object obj, IPoint geometry, IFeatureClass featureClass) { Dictionary <int, Clazz> dic = ArcGisService.GetTitleClzz(obj, featureClass.Fields); IFeatureCursor featureCursor = featureClass.Insert(true); IFeatureBuffer featureBuffer = featureClass.CreateFeatureBuffer(); IPoint point = new PointClass(); point.PutCoords(geometry.X, geometry.Y); featureBuffer.Shape = point; SetFeatureBufferValue(featureBuffer, dic, obj); featureCursor.InsertFeature(featureBuffer); }
/// <summary> /// 修改界址点 /// </summary> /// <param name="jzd"></param> public static void Update(IList <JZD> jzds) { ArcGisService.UpdateFeate(jzds, ArcGisService.GetTitleClzz <JZD>(GetJZDLayer().FeatureClass.Fields, false)); }