阅读:2197回复:3
怎么获取polygon的中心点坐标
<P>如题</P>
<P>请各位大侠提点思路</P> |
|
1楼#
发布于:2004-08-04 13:49
例子里好象就有了,以前看过,能直接获取选择到的polygon的中心坐标
|
|
|
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>
|
|
3楼#
发布于:2004-08-05 08:21
<P>谢谢</P>
|
|