<!-- Start Member Post -->
Есть код, задачи которого бежать по полигональной теме и искать
наложения полигонов и в соостветсвии с результатом записывать
статус в поле полигона
IPropertySet mSet = new PropertySetClass();
IQueryFilter mQFilt = new QueryFilterClass();
IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();
IFeatureWorkspace mFWork = null;
IFeatureClass mFClass = null;
IFeatureCursor mFCurs = null;
IFeature mFeat = null;
int mFID,mFOS,mCount,indx,mFl;
indx = 0;
mFID = 0;
mFOS = 0;
try
{
mSet.SetProperty("Server", (string)args.GetValue(0));
mSet.SetProperty("Databast", "sde");
mSet.SetProperty("Instance", "esri_sde");
mSet.SetProperty("User", "sde");
mSet.SetProperty("Password", "sde");
mSet.SetProperty("Version", "SDE.DEFAULT");
Console.WriteLine("Checking feature class {0} on the server {1}",
(string)args.GetValue(1), (string)args.GetValue(0));
mFWork = (IFeatureWorkspace)workspaceFactory.Open(mSet, 0);
mFClass = mFWork.OpenFeatureClass((string)args.GetValue(1));
mQFilt.WhereClause = (string)args.GetValue(2);
mFCurs = mFClass.Update(mQFilt, false);
mFeat = mFCurs.NextFeature();
mCount = mFClass.FeatureCount(mQFilt);
Console.WriteLine("Count of the feature {0}\n\r Object query for check
\"{1}\"\n\r Object with check \"{2}\"\n\r Tolerance {3} ", mCount,
(string)args.GetValue(2), (string)args.GetValue(3),
(string)args.GetValue(4));
mFID = mFClass.FindField("ID");
mFOS = mFClass.FindField("OBJECT_STATUS");
}
catch (Exception e)
{
Console.WriteLine("\n\r {0} Exception caught.\n\r", e);
}
while (mFeat != null)
{
mFl = CheckGeom(mFeat.Shape);
Console.Write ("\r {0} Status = {1} ID = {2}", indx , mFl,mFeat.get_Value(mFID ));
indx++;
if (mFl != 0)
{
StreamWriter mStream = new StreamWriter("check.log",true );
mStream.WriteLine("{1},{0} ", mFl, mFeat.get_Value(mFID), mFl);
mStream.Close();
mFeat.set_Value(mFOS, 1);
mFeat.Store();
}
else
{
if (indx == 91)
{
Console.Write("");
}
CheckIntersect(mFeat, mFClass, (string)args.GetValue(3), (float)Convert.ToDouble(args.GetValue(4)));
}
mFeat = mFCurs.NextFeature();
}