mxd腳本
1. 關於arcgis的python腳本編程, shape文件出png圖片問題
1、點類型的轉柵格:
PointToRasterexample1(Python
window)
.
importarcpy
fromarcpyimportenv
env.workspace="c:/data"
arcpy.PointToRaster_conversion("ca_ozone_pts.shp","ELEVATION",
"c:/output/ca_elev","MAXIMUM","",2000)
PointToRasterexample2
(stand-alonescript)
.
#Name:PointToRaster_Ex_02.py
#Description:.
#Requirements:ArcInfo
#Importsystemmoles
importarcpy
fromarcpyimportenv
#Setenvironmentsettings
env.workspace="C:/data"
#Setlocalvariables
inFeatures="ca_ozone_pts.shp"
valField="ELEVATION"
outRaster="c:/output/ca_elev02"
assignmentType="MAXIMUM"
priorityField=""
cellSize=2000
#ExecutePointToRaster
arcpy.PointToRaster_conversion(inFeatures,valField,outRaster,
assignmentType,priorityField,cellSize)
2、面類型的轉柵格:
PolygonToRasterexample1
(Pythonwindow)
.
importarcpy
fromarcpyimportenv
env.workspace="c:/data"
arcpy.PolygonToRaster_conversion("ca_counties.shp","NAME",
"c:/output/ca_counties.img",
"MAXIMUM_AREA","MALES",0.25)
PolygonToRasterexample2
(stand-alonescript)
.
#Name:PolygonToRaster_Ex_02.py
#Description:.
#Requirements:ArcInfo
#Importsystemmoles
importarcpy
fromarcpyimportenv
#Setenvironmentsettings
env.workspace="C:/data"
#Setlocalvariables
inFeatures="ca_counties.shp"
valField="NAME"
outRaster="c:/output/ca_counties"
assignmentType="MAXIMUM_AREA"
priorityField="MALES"
cellSize=0.5
#ExecutePolygonToRaster
arcpy.PolygonToRaster_conversion(inFeatures,valField,outRaster,
assignmentType,priorityField,cellSize)
3、線類型轉柵格
PolylineToRasterexample1
(Pythonwindow)
.
importarcpy
fromarcpyimportenv
env.workspace="c:/data"
arcpy.PolylineToRaster_conversion("roads.shp","CLASS","c:/output/roads.img",
"MAXIMUM_COMBINED_LENGTH","LENGTH",30)
PolylineToRasterexample2
(stand-alonescript)
.
#Name:PolylineToRaster_Ex_02.py
#Description:.
#Requirements:ArcInfo
#Importsystemmoles
importarcpy
fromarcpyimportenv
#Setenvironmentsettings
env.workspace="C:/data"
#Setlocalvariables
inFeatures="roads.shp"
valField="CLASS"
outRaster="c:/output/roads.tif"
assignmentType="MAXIMUM_COMBINED_LENGTH"
priorityField="LENGTH"
cellSize=30
#ExecutePolylineToRaster
arcpy.PolylineToRaster_conversion(inFeatures,valField,outRaster,
assignmentType,priorityField,cellSize)
2. mxd鏂囦歡淇鏀規暟鎹婧愯佺礌闆嗕笉鍚
瀵逛簬mxd鏂囦歡淇鏀規暟鎹婧愯佺礌闆嗕笉鍚岀殑鍘熷洜鏈変互涓嬪嚑鐐癸細
1. 鏁版嵁婧愭枃浠惰礬寰勫彉鏇達細褰搈xd鏂囦歡涓寮曠敤鐨勬暟鎹婧愭枃浠剁殑璺寰勫彂鐢熷彉鍖栨椂錛屼緥濡傛枃浠惰縐誨姩鍒板叾浠栨枃浠跺す鎴栭噸鍛藉悕錛宮xd鏂囦歡灝辨棤娉曟壘鍒扮浉搴旂殑鏁版嵁婧愭枃浠訛紝瀵艱嚧瑕佺礌闆嗕笉鍚屻
2. 鏁版嵁婧愭枃浠惰鍒犻櫎鎴栨崯鍧忥細濡傛灉mxd鏂囦歡涓寮曠敤鐨勬暟鎹婧愭枃浠惰鍒犻櫎鎴栬呮崯鍧忥紝mxd鏂囦歡灝辨棤娉曡塊棶鐩稿簲鐨勬暟鎹錛屽艱嚧瑕佺礌闆嗕笉鍚屻
3. 鏁版嵁搴撹繛鎺ラ棶棰橈細濡傛灉mxd鏂囦歡涓寮曠敤鐨勬暟鎹婧愭槸鏁版嵁搴擄紝褰撴暟鎹搴撹繛鎺ュ彂鐢熼棶棰樻椂錛屼緥濡傛暟鎹搴撳悕縐版垨鐧誨綍鍑鎹鍙戠敓鍙樺寲錛宮xd鏂囦歡鏃犳硶姝g『榪炴帴鏁版嵁搴擄紝瀵艱嚧瑕佺礌闆嗕笉鍚屻
闇瑕佹敞鎰忕殑鏄錛屽綋mxd鏂囦歡淇鏀規暟鎹婧愯佺礌闆嗕笉鍚屾椂錛屽彲鑳戒細瀵艱嚧鍦板浘鏄劇ず涓嶅噯紜鎴栨棤娉曟e父鍔犺澆鏁版嵁銆傚湪瑙e喅姝ら棶棰樻椂錛屽彲浠ュ皾璇曚互涓嬫柟娉曪細
1. 閲嶆柊榪炴帴鏁版嵁婧愶細閫氳繃淇鏀筸xd鏂囦歡涓鐨勬暟鎹婧愯礬寰勬垨閲嶆柊閰嶇疆鏁版嵁搴撹繛鎺ヤ俊鎮錛岀『淇漨xd鏂囦歡鑳藉熸g『璁塊棶鍒扮浉搴旂殑鏁版嵁婧愭枃浠躲
2. 瀵繪壘澶囦喚鏂囦歡錛氬傛灉涔嬪墠鏈夊囦喚鐨刴xd鏂囦歡錛屽彲浠ュ皾璇曚嬌鐢ㄥ囦喚鏂囦歡鏇挎崲褰撳墠鐨刴xd鏂囦歡錛屼互鎮㈠嶅埌涔嬪墠鐨勬暟鎹婧愯佺礌闆嗐
3. 閲嶆柊鍔犺澆鏁版嵁錛氬傛灉鏁版嵁婧愭枃浠舵湭琚鍒犻櫎鎴栨崯鍧忥紝浣嗘槸mxd鏂囦歡鏃犳硶姝g『璁塊棶錛屽彲浠ュ皾璇曢噸鏂板姞杞芥暟鎹錛岀『淇濇暟鎹婧愭枃浠剁殑鍙鐢ㄦс
鎬諱箣錛宮xd鏂囦歡淇鏀規暟鎹婧愯佺礌闆嗕笉鍚屽彲鑳芥槸鐢變簬鏂囦歡璺寰勫彉鏇淬佹暟鎹婧愭枃浠舵崯鍧忔垨鏁版嵁搴撹繛鎺ラ棶棰樼瓑寮曡搗鐨勩傚湪瑙e喅闂棰樻椂錛屽彲浠ュ皾璇曢噸鏂拌繛鎺ユ暟鎹婧愩佷嬌鐢ㄥ囦喚鏂囦歡鎴栭噸鏂板姞杞芥暟鎹鏉ユ仮澶嶆g『鐨勮佺礌闆嗐
3. 鍐呰屾潵鍛婅瘔涓嬪啋闄╁矝綰㈤薊瀛愭搗鐩2鐨勫偦鎸傝剼鏈瑍錛
璧板埌,1073,70
璧板埌,750,70
璺寵穬
涓婄埇
璧板埌,35,-94
璺寵穬
涓婄埇
璧板埌,-874,70
寰鐜
鑷宸卞紕鎴怲XT鏂囦歡灝監K 銆傘
4. 鎬庢牱浣跨敤python宸ュ叿榪涜屾壒閲忓嚭鍥撅紵
1銆侀栧厛錛屾垜浠瑕佽繘琛屾壒閲忓嚭鍥撅紝浣嗘槸鏁版嵁椹卞姩欏甸潰鍙鑳芥壒閲忓嚭pdf鏍煎紡鐨勫浘銆備笉澶鏂逛究銆傚湪榪欑嶆儏鍐典笅銆傛垜鍛婅瘔澶у朵竴涓鍙浠ユ壒閲忓煎嚭鍏朵粬鏍煎紡濡傦細JPG鏍煎紡鍥劇墖鐨勬柟娉曘