ljin
路人甲
路人甲
  • 注册日期2004-06-14
  • 发帖数31
  • QQ
  • 铜币238枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2197回复:3

怎么获取polygon的中心点坐标

楼主#
更多 发布于:2004-08-04 09:43
<P>如题</P>
<P>请各位大侠提点思路</P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2004-08-04 13:49
例子里好象就有了,以前看过,能直接获取选择到的polygon的中心坐标
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
yulu11
外卖仔
外卖仔
  • 注册日期2004-07-12
  • 发帖数62
  • QQ
  • 铜币766枚
  • 威望0点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
2楼#
发布于:2004-08-04 15:37
<P>使用field calculation。下面是arcgis help里的讲解:</P><P>Adding the x,y coordinates of the centroid of a polygon layer to a new field</P><DIV><OL><LI>Optionally, <a>start an edit session</A> in ArcMap. Calculating a field is faster outside of an edit session, but you won't be able to undo the calculation. <LI><a href="mk:@MSITStore:G:\arcgis\arcexe83\Help\ArcMap.chm::/opening_a_layer_s_attribute_table.htm" target="_blank" >Open the attribute table of the layer</A> of the layer you want to edit. <LI>Right-click the field heading for the X field (if there is no X field you can add a new field by clicking the options button and selecting the new field option). <LI>Click Calculate Values. <LI>Check Advanced. <LI>Type the following VBA statement in the first text box. <PRE><CODE>Dim dblX As DoubleDim pArea As IAreaSet pArea = [Shape]dblX = pArea.Centroid.X</CODE></PRE><LI>Type the variable dblX in the text box directly under the X field name. <LI>Click OK. <P>You can repeat the same process for updating a field with the Y coordinates for the centroid point of each polygon in the layer. </P></LI></OL><TABLE cellPadding=5 width="85%" summary=tips border=0><TR><TD><H3>Tip</H3><UL><LI>The property X returns a field type of double. For best results, your X field should also be a double field type. </LI></UL></TD></TR></TABLE></DIV>
举报 回复(0) 喜欢(0)     评分
ljin
路人甲
路人甲
  • 注册日期2004-06-14
  • 发帖数31
  • QQ
  • 铜币238枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2004-08-05 08:21
<P>谢谢</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部