public void SelByLoc(IFeatureLayer pLayer0, IFeatureLayer pLayer1, double dblBufferDistance, string filter)
{
IGeometryCollection pGeoCollection;
pGeoCollection = new GeometryBagClass();
IGeometryCollection pGeometryBag;
pGeometryBag = new GeometryBagClass();
IFeatureCursor pCursor;
IFeatureLayer pFeatureLayer = pLayer1;
IFeatureLayer pFeatureLayer_1 = pLayer0;
IFeatureClass pIntersectFeatCls;
pIntersectFeatCls = pFeatureLayer_1.FeatureClass;
IFeatureClass pIntersectFeatCls_1;
pIntersectFeatCls_1 = pFeatureLayer.FeatureClass;
pCursor = pIntersectFeatCls.Search(null, false);
IFeatureCursor pCursor_1;
if (filter != "")
{
IQueryFilter QF = new QueryFilterClass();
QF.WhereClause = filter;
pCursor_1 = pIntersectFeatCls_1.Search(QF, false);
}
else
{
pCursor_1 = pIntersectFeatCls_1.Search(null, false);
}
IFeature pFeature;
pFeature = pCursor.NextFeature();
System.Object obj1 = Missing.Value;
System.Object obj2 = null;
while (pFeature != null){
pGeoCollection.AddGeometry(pFeature.ShapeCopy, ref obj1, ref obj2);
pFeature = pCursor.NextFeature();
}
pFeature = pCursor_1.NextFeature();
obj1 = Missing.Value;
obj2 = null;
while (pFeature != null)
{
pGeometryBag.AddGeometry(pFeature.ShapeCopy, ref obj1, ref obj2);
pFeature = pCursor_1.NextFeature();
}
ITopologicalOperator pTopologicalOperator;
pTopologicalOperator = (ITopologicalOperator)pGeometryBag;
IGeometry pAddGeometry;
pAddGeometry = pTopologicalOperator.Buffer(dblBufferDistance);
ISpatialFilter pSpatialFilter;
pSpatialFilter = new SpatialFilterClass();
pSpatialFilter.Geometry = pAddGeometry;
pSpatialFilter.GeometryField = "SHAPE";
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
IFeatureSelection pFSel = (IFeatureSelection)pFeatureLayer_1;
pFSel.SelectFeatures(pSpatialFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
axMapControl1.ActiveView.Refresh();
}
вот процедура по которой я делаю выборку. в переменную dblBufferDistance указываю размер буферной зоны, но при значении 1 у меня буферная зона становится огромная (думаю она использует градусы в качестве ед. измерения). как мне перевести ее в метры?