QGIS 3.14鎻掍欢寮€鍙戔€斺€擶in10绯荤粺PyCharm寮€鍙戠幆澧冩惌寤哄洓姝ヨ蛋
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了QGIS 3.14鎻掍欢寮€鍙戔€斺€擶in10绯荤粺PyCharm寮€鍙戠幆澧冩惌寤哄洓姝ヨ蛋相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e9%ab%98%e7%ba%a7' title='楂樼骇'>楂樼骇
鎼缓 dbca pack 璁剧疆 閭 璧勬簮 html 鐜鍙橀噺path鍓嶈█锛氭渶杩戝疄涔犺姹傚仛涓€涓猀GIS鎻掍欢锛岀綉涓婂叧浜嶲GIS 3.14鎻掍欢寮€鍙戠幆澧冩惌寤虹殑鏂囨。涓嶅锛岃€屼笖涔熶笉绠楀お鍏ㄩ潰銆傛濂藉疄涔犵殑鏃跺€欏啓浜嗕竴涓枃妗o紝鍦ㄨ繖閲岀粰澶у鍒嗕韩涓€涓嬨€?/p>
鍥犱负鏄疻ord杞殑Markdown锛屽彲鑳芥枃绔犳牸寮忕暐鏈夐棶棰橈紝涓嶈繃娌″叧绯诲暒锛堛€傦級
涓€銆丳yQGIS瀹夎
鍦╳indows绯荤粺涓嬶紝QGIS瀹夎鍖呬細鑷姩瀹夎PyQGIS妯″潡锛屾湰鏂囦互windows绯荤粺杩涜璁茶В銆?/p>
瀹為檯涓婏紝濡傛灉浣跨敤鏂扮増鏈殑QGIS for
Linux鎴朚ac涔熶細瀹夎PyQGIS锛屽彲浠ュ弬鑰僎GIS瀹樻柟鏂囨。銆?/p>
浜屻€丳ython鐜鍙橀噺閰嶇疆
锛?锛夐厤缃甈ath
閰嶇疆Python鐜鍙橀噺涓昏鏄负浜嗕粠鍛戒护琛岃繍琛宲ython鍜岃皟鐢╬yqgis搴撱€?/p>
鍏堣缃郴缁熷彉閲弍ath锛屾渶濂芥槸鏀惧埌鏈€鍓嶉潰锛岄槻姝㈣鍏朵粬鍦版柟瀹夎鐨刾ython瑕嗙洊锛屽锛?/p>
鎿嶄綔杩囩▼濡傜郴鍒楀浘锛氭鐢佃剳锛堝彸閿級鈥斺€曞睘鎬р啋绯荤粺鈥斺€旈珮绾х郴缁熻缃啋绯荤粺灞炴€р€斺€旂幆澧冨彉閲忊啋鐜鍙橀噺|绯荤粺鍙橀噺
鍦ㄧ郴缁熷彉閲忎腑鎵惧埌Path锛岀偣鍑荤紪杈?/p>
娣诲姞鐜鍙橀噺锛?/p>
D:QGIS 3.14in
D:QGIS 3.14appsqgisin
D:QGIS 3.14appsQt5in
(鍏朵腑D:QGIS 3.14 鏄綘QGIS鐨勫畨瑁呬綅缃?
锛?锛夐厤缃甈YTHONPATH
PYTHONPATH涓昏鏄负浜嗚Python鑳藉鎵惧埌PyQGIS鐨勫悇绉嶄緷璧栨ā鍧楋紝淇濊瘉姝e父浣跨敤銆?/p>
鍦ㄧ郴缁熷彉閲忎腑鐐瑰嚮鏂板缓锛屾柊澧炲悕涓篜YTHONPATH绯荤粺鍙橀噺銆?/p>
鍙橀噺鍊艰缃负锛?/strong>
D:QGIS 3.14appsPython37;
D:QGIS 3.14appsqgisin;
D:QGIS3.14appsqgispython;
D:QGIS 3.14appsPython37lib;
D:QGIS 3.14appsPython37Libsite-packages;
D:QGIS 3.14appsPython37DLLs;
D:QGIS 3.14appsPython37Scripts;
锛堝叾涓璂:QGIS 3.14鏄綘鐨剄gis瀹夎璺緞,python37鏄痲gis鑷甫python鐨勭増鏈級
銆?/p>
杈撳叆python3鎴栬€卲ython锛岃繍琛宲ython銆傝python鐗堟湰搴斾负qgis鑷甫python鐗堟湰銆?/p>
鐒跺悗杈撳叆锛?/p>
import qgis.core
import qgis.user
import qgis.gui
import console
娌℃湁鎻愮ず閿欒鍗充负閰嶇疆鎴愬姛
涓夈€佷娇鐢≦GIS鏋勫缓鎻掍欢椤圭洰
鎻掍欢瀹夎鍜屾瀯寤烘彃浠堕」鐩殑娴佺▼濡備笅锛?/p>
锛?锛?鎻掍欢瀹夎
鎵撳紑QGIS锛屾彃浠垛€斺€?/p>
鍥犱负鎴戜滑鍚庨潰浣跨敤PyCharm寮€鍙戯紝QGIS涓璕emote Debug杩欎釜宸ュ叿鍙湁鍙棤銆?/p>
https://www.osgeo.cn/qgisdoc/docs/pyqgis_developer_cookbook/plugins/index.html
鍒涘缓鎻掍欢宸ョ▼
閲嶆柊鍚姩QGIS
杩欓噷鐨凜lass name鏄彃浠剁殑绫诲悕锛孭lugin name鏄綘鐨勬彃浠跺悕锛孧oule
name鏄痯ython妯″潡鐨勫悕绉般€傚鏋滃彧鏄紑鍙戠粌涔狅紝鍚庨潰閭d簺涔变竷鍏碂鐨勯殢渚垮~灏卞ソ銆?/p>
濡傛灉涓嶆兂鍙戝竷鎻掍欢锛屽彧鍋氱粌涔犱娇鐢紝杩欓噷寤鸿澶у鍕鹃€塅lag the plugin as
experimental閫夐」
杩欓噷閫夋嫨涔嬪墠璁剧疆鐨勬彃浠跺伐浣滃尯鐨勮矾寰勶紝鑷姩鐢熸垚鐨勬彃浠舵ā鏉垮氨浼氭斁缃簬璇ョ洰褰曚笅銆?/p>
锛?/p>
涓轰簡閬垮厤涓嶅繀瑕佺殑楹荤儲銆傛彃浠剁敓鎴愬畬姣曞悗锛屽厛涓嶈鍔犺浇鎻掍欢锛屽惁鍒欎細鎻愮ず缂哄皯锛?br> resources.py 鏂囦欢
濡傛灉寮瑰嚭浠ヤ笅瀵硅瘽妗嗭紝涔熸殏鏃跺厛涓嶇锛屽挶浠箣鍚庡啀澶勭悊銆?/p>
杩欐牱鎻掍欢椤圭洰妯℃澘鍒涘缓濂戒簡锛屽彲浠ュ湪鍒氭墠鎴戜滑鍒涘缓鐨勭洰褰曚笅鏌ョ湅
https://jingyan.baidu.com/article/acf728fd862d44f8e510a385.html
褰撶劧锛屽鏋滆寰楄嚜宸变笉闇€瑕佺敤鍒拌皟璇曞姛鑳斤紝涓嬭浇Community鐗堟湰涔熷彲銆備笅闈互Community鐗堟湰璁茶ВPyCharm鐨勭幆澧冩惌寤恒€侾rofessional鐗堟湰鐨勬惌寤鸿繃绋嬩篃鏄竴鏍风殑銆?/p>
瀹夎Pycharm Community娴佺▼锛屽涓嬶細
锛?锛?涓嬭浇
瀹樻柟缃戠珯 https://www.jetbrains.com/pycharm/
閫夋嫨淇濆瓨鍚庯紝绛夊緟涓嬭浇銆?/p>
鎵惧埌涓嬭浇鏂囦欢
鍙屽嚮瀹夎鏂囦欢銆?/p>
閫夋嫨瀹夎鐩綍锛孭ycharm闇€瑕佺殑鍐呭瓨杈冨锛屽缓璁皢鍏跺畨瑁呭湪D鐩樻垨鑰匛鐩橈紝涓嶅缓璁斁鍦ㄧ郴缁熺洏C鐩橈細
create desktop
shortcut锛堝垱寤烘闈㈠揩鎹锋柟寮忥級锛氱郴缁?2浣嶅氨閫?2-bit,绯荤粺64浣嶅氨閫?4-bit銆傜幇鍦ㄥぇ澶氭暟閮芥槸64浣嶄簡锛屼笉娓呮绯荤粺绫诲瀷锛氭垜鐨勭數鑴?銆嬪彸閿?銆嬪睘鎬?/p>
update path variable(restart needed)鏇存柊璺緞鍙橀噺(闇€瑕侀噸鏂板惎鍔?锛歛dd launchers
dir to the path锛堝皢鍚姩鍣ㄧ洰褰曟坊鍔犲埌path涓級銆傝繖閲屾垜寤鸿澶у娣诲姞鍒扮幆澧冨彉閲廝ATH銆?/p>
update context menu锛堟洿鏂颁笂涓嬫枃鑿滃崟锛夛細add open folder as
project锛堟坊鍔犳墦寮€鏂囦欢澶逛綔涓洪」鐩級銆傚彲浠ヤ笉閫夈€?/p>
create associations 鍒涘缓鍏宠仈锛氬叧鑱?py鏂囦欢锛屽弻鍑婚兘鏄互pycharm鎵撳紑銆?/p>
璁剧疆UI棰滆壊
鐩存帴涓嬩竴姝ュ嵆鍙?/p>
杩欓噷閫夋嫨Open鎵撳紑鎴戜滑涔嬪墠鐢熸垚鎻掍欢椤圭洰銆傜劧鍚嶧ile-Settings鎵撳紑璁剧疆
鎵撳紑璁剧疆鍚庯紝鎵惧埌python interpreter锛岀偣鍑诲彸涓婅鐨勮缃瓵dd
閫夋嫨System Interpreter锛堣繖閲屼笉鎺ㄨ崘澶у鑷繁鏋勫缓铏氭嫙鐜锛夛紝娣诲姞Python瑙i噴鍣細
D:QGIS 3.14appsPython37python.exe
锛堝叾涓璂:QGIS 3.14鏄綘鐨勫畨瑁呰矾寰勶級
鍙互鐪嬪埌锛孭yCharm宸茬粡甯垜浠妸鐩稿叧鐨勫寘寮曞叆杩涙潵浜?/p>
娣诲姞QtDesigner锛岀敤浜庣紪杈慤I
Name锛歈tDesigner
Program锛欴:QGIS 3.14appsQt5indesigner.exe
Working directory锛氫綘鐨勬彃浠堕」鐩殑鐩綍
娣诲姞PyUIC锛圲I杞崲宸ュ叿锛夛紝鐢ㄤ簬灏唘i杞崲涓簆y妯″潡
Name锛歅yuic
Program锛欴:QGIS 3.14appsPython37Scriptspyuic5.bat
Arguments: $FileName$ -o $FileNameWithoutExtension$.py
Working directory锛氫綘鐨勬彃浠堕」鐩殑鐩綍
锛堝叾涓瑼rguments鐩稿綋浜庝竴娈垫帶鍒跺彴鍛戒护锛屾槸璋冪敤pyuic5.bat鐨勫弬鏁帮級
娣诲姞PyRCC锛堣祫婧愯浆鎹㈠伐鍏凤級锛岀敤浜庡皢qrc杞崲涓簆y妯″潡
Name锛歅yrcc
Program锛欴:QGIS 3.14appsPython37Scriptspyrcc5.bat
Arguments: $FileName$ -o $FileNameWithoutExtension$.py
Working directory锛氫綘鐨勬彃浠堕」鐩殑鐩綍
锛堣繖閲岀殑Arguments涔熸槸鍚屾牱鐨勯亾鐞嗭級
锛?锛夊垱寤簉esources.py鍜屽浘褰㈢晫闈y鏂囦欢
鍒涘缓鍥惧舰鐣岄潰py鏂囦欢锛?/p>
鎵惧埌椤圭洰鐩綍涓嬶紝鎵╁睍鍚嶄负ui鐨勬枃浠讹紙鏂囦欢鍚嶆牴鎹綘璁剧疆鐨勬彃浠舵ā鍧楀悕鏈夋墍涓嶅悓锛夛紝鍙抽敭External
Tools-Pyuic杩愯鎵╁睍宸ュ叿
娌℃湁鎶ラ敊锛屽苟涓斿湪椤圭洰鐩綍涓嬪嚭鐜板悓鍚嶇殑py鏂囦欢鍒欎负杞崲鎴愬姛銆?/p>
鍚岀悊锛屽resources.rcc鐨勬枃浠讹紝鍙抽敭閫夋嫨鍙抽敭External Tools-Pyrcc
鍦ㄥ凡瀹夎鐨勬彃浠朵腑鎵惧埌骞跺嬀閫夋垜浠殑鎻掍欢锛岀劧鍚庤繍琛屾垜浠殑鎻掍欢鍗冲彲銆?/p>
以上是关于QGIS 3.14鎻掍欢寮€鍙戔€斺€擶in10绯荤粺PyCharm寮€鍙戠幆澧冩惌寤哄洓姝ヨ蛋的主要内容,如果未能解决你的问题,请参考以下文章