arcgis engine C# 開發,如何實現計算點到面距離的計算?謝謝~:一般面與一般面相交

arcengine判斷一個點是不是 在一個面中
用IRelationalOperator.Contains Method
具體參考Developer Help
ArcEngine 判斷線是否為面的邊界
IRelationalOperator.Overlaps方法 判斷線與多邊形的邊界是否重疊
ITopologicalOperator.Boundary獲取多邊形的邊界
arcgis engine C# 開發,如何實現計算點到面距離的計算?謝謝~
在AE中這叫點選查詢,其中你可你自己的坐標來替換 下面的
IMap pMap = axMapControl1.Map;
IActiveView pActiveView = pMap as IActiveView;
IFeatureLayer pFeatureLayer = pMap.get_Layer(0) as IFeatureLayer;
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
//設置點擊點的位置
IPoint point = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
ITopologicalOperator pTOpo = point as ITopologicalOperator;
double length;
length = ConvertPixelsToMapUnits(pActiveView, 4);
IGeometry pBuffer = pTOpo.Buffer(length);
IGeometry pGeomentry = pBuffer.Envelope;
//空間濾過器
ISpatialFilter pSpatialFilter = new SpatialFilter();
pSpatialFilter.Geometry = pGeomentry;
//根據被選擇要素的不同,設置不同的空間濾過關系
switch (pFeatureClass.ShapeType)
{
case esriGeometryType.esriGeometryPoint:
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelContains;
break;
case esriGeometryType.esriGeometryPolyline:
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelCrosses;
break;
case esriGeometryType.esriGeometryPolygon:
pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
break;
}
IFeatureSelection pFSelection = pFeatureLayer as IFeatureSelection;
pFSelection.SelectFeatures(pSpatialFilter, esriSelectionResultEnum.esriSelectionResultNew, false);
ISelectionSet pSelectionset = pFSelection.SelectionSet;
ICursor pCursor;
pSelectionset.Search(null, true, out pCursor);
IFeatureCursor pFeatCursor = pCursor as IFeatureCursor;
IFeature pFeature = pFeatCursor.NextFeature();
while (pFeature != null)
{
pMap.SelectFeature(pFeatureLayer, pFeature);
pFeature = pFeatCursor.NextFeature();
pFeture.get_value("");//在這里你可以寫上想要獲取的屬性的字段
}
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphicSelection, null, null);
上述的自定義函數是將距離的轉換
private double ConvertPixelsToMapUnits(IActiveView pActiveView, double pixelUnits)
{
// Uses the ratio of the size of the map in pixels to map units to do the conversion
IPoint p1 = pActiveView.ScreenDisplay.DisplayTransformation.VisibleBounds.UpperLeft;
IPoint p2 = pActiveView.ScreenDisplay.DisplayTransformation.VisibleBounds.UpperRight;
int x1, x2, y1, y2;
pActiveView.ScreenDisplay.DisplayTransformation.FromMapPoint(p1, out x1, out y1);
pActiveView.ScreenDisplay.DisplayTransformation.FromMapPoint(p2, out x2, out y2);
double pixelExtent = x2 - x1;
double realWorldDisplayExtent = pActiveView.ScreenDisplay.DisplayTransformation.VisibleBounds.Width;
double sizeOfOnePixel = realWorldDisplayExtent / pixelExtent;
return pixelUnits * sizeOfOnePixel;
}
求助:如何利用C#和ArcEngine計算通視區域的面積?
可以域,你能算出可視的范圍么?有算法么?如果有,就方便了
win7 64位系統,有關C#和arcengine二次開發的沒有注冊類和license方面的問題!
在項目屬性里設置“生成”=>“目標平臺”為x86而不是默認的ANY CPU
ArcEngine只是32位的,64為需要把環境改成32位的 。。。
C# ArcEngine二次開發,往地圖中添加點時,點的坐標賦值是經緯度坐標還是平面坐標?
【arcgis engine C# 開發,如何實現計算點到面距離的計算?謝謝~:一般面與一般面相交】把你需要采用的平面坐標也說出來,建立圖層時圖層有個上下左右范圍,如果是經緯度這個值就很小,所以報錯說坐標或測量值超出范圍 。當然把你的功能說清楚也可能我會寫點代碼 。
arcengine 如何使兩個面要素不重疊
DataSet數據集對象:可分為兩大:Table和GeoDataset,GeoDataset是一個抽象類,了擁間屬性的數據集,FeatureDataset、要素類FeatureClass、TIN和柵格數據集RasterDataset 。
創建要素數據集就是創建FeatureDataset,創建線要素和面要素就是創建FeatureClass,只是其Geometry不同而已 。
多看看AE開發的書籍吧 。