å¨ç¹shpæ件ä¸ï¼ç¹çåæ ä¿¡æ¯ä¿åäºshpæ件çshapeå段ä¸ï¼èä¸è½ç´æ¥çå°åæ ã
æ们å¯ä»¥éè¿æåç¹çç»çº¬åº¦å¹¶ä¿åäºç¹shpæ件çå±æ§è¡¨Xï¼æç»åº¦ï¼ãYï¼æ纬度ï¼å段ä¸ãæ¹æ³å¦ä¸ï¼
1) å¨ArcMapä¸æå¼ç¹shpæ件çå±æ§è¡¨ã
2) åå»ãOptionsã-> Add Fieldâ¦ï¼æ·»å æ°å段X_coordï¼æ ¼å¼å¦å¾ï¼
ç¶ååå»OKï¼åX_coordå段添å å°å±æ§è¡¨ä¸ã
3) å³å»X_coordå段ï¼éæ©Field Calculator,å¨å¼¹åºç对è¯æ¡ä¸éYesåï¼åºç°ç¼è¾çªå£Field Calculatorã
4) å¨Field Calculatorçªå£ä¸ï¼å¾éAdvanced
éæ©æ¡ï¼ç¶åå¨Pre-Logic VBA Script Code代ç çªå£ä¸ï¼è¾å
¥å¦ä¸ä»£ç ï¼
Dim dblX as double
Dim pPoint as IPoint
Set pPoint = [Shape]
dblX = pPoint.X
å¨ä¸é¢çX_coordçªå£ä¸è¾å
¥dblXï¼å
·ä½å¦å¾æ示ï¼
5)å®æ以ä¸æä½åï¼åå»OKæé®ï¼åç¹çç»åº¦ä¿¡æ¯æ·»å å°X_coordå段ä¸ã
6)éå¤ä»¥ä¸æä½ï¼æ·»å Y_coordå段ï¼å¹¶æ´æ¹ä»£ç å¦ä¸ï¼
Dim dblY as double
Dim pPoint as IPoint
Set pPoint = [Shape]
dblY = pPoint.Y
并修æ¹ä¸å¾æ¡ä¸3ææ 示ç为dblYï¼åå»OKï¼åå®æY_coordä¿¡æ¯çæåä¸æ·»å ã
å¦å¾ä¸ºæåçä¿¡æ¯ä¸åæ¥æç»çº¬åº¦ç¹çæ¯è¾ï¼å¯è§å®å
¨ä¸è´ã
追é®Optionsï¼å¨åªé