{"id":1167533,"date":"2025-01-15T15:46:12","date_gmt":"2025-01-15T07:46:12","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1167533.html"},"modified":"2025-01-15T15:46:14","modified_gmt":"2025-01-15T07:46:14","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8arcgis%e9%87%8c%e6%89%93%e5%bc%80python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1167533.html","title":{"rendered":"\u5982\u4f55\u5728arcgis\u91cc\u6253\u5f00python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25211414\/5d6fc72d-03eb-4413-82af-b1059310cfe0.webp\" alt=\"\u5982\u4f55\u5728arcgis\u91cc\u6253\u5f00python\" \/><\/p>\n<p><p> <strong>\u5728ArcGIS\u4e2d\u6253\u5f00Python\u7684\u65b9\u6cd5\u6709\u591a\u4e2a\uff0c\u53ef\u4ee5\u901a\u8fc7ArcGIS Pro\u7684Python\u7a97\u53e3\u3001\u4f7f\u7528ArcGIS Python API\u3001\u901a\u8fc7Jupyter Notebook\u3001\u4f7f\u7528IDLE\u6216\u5176\u4ed6Python IDE\u7b49\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002<\/strong> \u5176\u4e2d\uff0c<strong>\u5728ArcGIS Pro\u7684Python\u7a97\u53e3\u4e2d\u6253\u5f00Python\u662f\u6700\u76f4\u89c2\u548c\u4fbf\u6377\u7684<\/strong>\uff0c\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u8fd9\u4e00\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u5728ArcGIS Pro\u4e2d\u6253\u5f00Python\u7a97\u53e3\u7684\u65b9\u6cd5\u975e\u5e38\u7b80\u5355\u3002\u9996\u5148\uff0c\u542f\u52a8ArcGIS Pro\u5e76\u6253\u5f00\u4e00\u4e2a\u9879\u76ee\u6216\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\u3002\u7136\u540e\uff0c\u5728ArcGIS Pro\u7684\u4e3b\u83dc\u5355\u4e2d\uff0c\u9009\u62e9\u201c\u63d2\u5165\u201d\u9009\u9879\u5361\uff0c\u63a5\u7740\u70b9\u51fb\u201cPython\u201d\u6309\u94ae\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728ArcGIS Pro\u4e2d\u6253\u5f00Python\u7a97\u53e3\u3002\u5728\u8fd9\u4e2a\u7a97\u53e3\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u7528\u4e8e\u5730\u7406\u5904\u7406\u3001\u6570\u636e\u5206\u6790\u7b49\u5404\u79cd\u4efb\u52a1\u3002\u8fd9\u4e2a\u65b9\u6cd5\u4e0d\u4ec5\u4fbf\u6377\uff0c\u8fd8\u80fd\u76f4\u63a5\u8bbf\u95eeArcGIS Pro\u4e2d\u7684\u6240\u6709\u5de5\u5177\u548c\u529f\u80fd\uff0c\u975e\u5e38\u9002\u5408\u65b0\u624b\u548c\u9700\u8981\u5feb\u901f\u8fdb\u884c\u5730\u7406\u5904\u7406\u7684\u7528\u6237\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528ArcGIS Pro\u7684Python\u7a97\u53e3<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u542f\u52a8ArcGIS Pro\u5e76\u6253\u5f00\u9879\u76ee\uff1a<\/strong> \u5728\u4f7f\u7528ArcGIS Pro\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u542f\u52a8ArcGIS Pro\u5e76\u6253\u5f00\u4e00\u4e2a\u73b0\u6709\u7684\u9879\u76ee\u6216\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\u3002\u8fd9\u4e00\u6b65\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\uff0c\u56e0\u4e3a\u6240\u6709\u7684\u64cd\u4f5c\u90fd\u5c06\u57fa\u4e8e\u5f53\u524d\u7684\u9879\u76ee\u8fdb\u884c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6253\u5f00Python\u7a97\u53e3\uff1a<\/strong> \u5728ArcGIS Pro\u7684\u4e3b\u83dc\u5355\u4e2d\uff0c\u70b9\u51fb\u201c\u63d2\u5165\u201d\u9009\u9879\u5361\uff0c\u7136\u540e\u5728\u5de5\u5177\u680f\u4e2d\u627e\u5230\u5e76\u70b9\u51fb\u201cPython\u201d\u6309\u94ae\u3002\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u7a97\u53e3\uff0c\u79f0\u4e3aPython\u7a97\u53e3\u3002\u5728\u8fd9\u4e2a\u7a97\u53e3\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\uff1a<\/strong> \u5728Python\u7a97\u53e3\u4e2d\uff0c\u53ef\u4ee5\u8f93\u5165\u4efb\u4f55Python\u4ee3\u7801\uff0c\u5e76\u901a\u8fc7\u6309\u4e0b\u201cEnter\u201d\u952e\u6765\u6267\u884c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8f93\u5165\u7b80\u5355\u7684Python\u547d\u4ee4\uff0c\u5982\u6253\u5370\u6587\u672c\u6216\u6267\u884c\u6570\u5b66\u8fd0\u7b97\uff0c\u4e5f\u53ef\u4ee5\u8c03\u7528ArcGIS\u7684\u5730\u7406\u5904\u7406\u5de5\u5177\u6765\u6267\u884c\u590d\u6742\u7684\u5730\u7406\u5904\u7406\u4efb\u52a1\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528ArcGIS Pro\u7684Python\u7a97\u53e3\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u4fbf\u6377\u6027\u548c\u76f4\u63a5\u6027\u3002\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u5728ArcGIS Pro\u4e2d\u8bbf\u95ee\u548c\u4f7f\u7528\u6240\u6709\u7684\u5730\u7406\u5904\u7406\u5de5\u5177\u548c\u529f\u80fd\uff0c\u65e0\u9700\u5207\u6362\u5230\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u6216\u754c\u9762\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u5feb\u901f\u8fdb\u884c\u5730\u7406\u5904\u7406\u548c\u6570\u636e\u5206\u6790\u7684\u7528\u6237\u6765\u8bf4\uff0c\u662f\u4e00\u4e2a\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528ArcGIS Python API<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5ArcGIS Python API\uff1a<\/strong> \u8981\u4f7f\u7528ArcGIS Python API\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86\u8be5API\u3002\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\uff08\u5982Anaconda\u6216pip\uff09\u6765\u5b89\u88c5\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5ArcGIS Python API\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install -c esri arcgis<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install arcgis<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5bfc\u5165ArcGIS Python API\uff1a<\/strong> \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u811a\u672c\u6216Jupyter Notebook\u4e2d\u5bfc\u5165ArcGIS Python API\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u6765\u5bfc\u5165API\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from arcgis.gis import GIS<\/p>\n<p>from arcgis.features import FeatureLayer<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528ArcGIS Python API\u8fdb\u884c\u5730\u7406\u5904\u7406\uff1a<\/strong> \u5bfc\u5165API\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5404\u79cdAPI\u529f\u80fd\u6765\u8fdb\u884c\u5730\u7406\u5904\u7406\u548c\u6570\u636e\u5206\u6790\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u8fde\u63a5\u5230ArcGIS Online\u6216ArcGIS Enterprise\uff0c\u8bbf\u95ee\u548c\u64cd\u4f5c\u5730\u7406\u6570\u636e\uff0c\u6267\u884c\u7a7a\u95f4\u5206\u6790\u7b49\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528ArcGIS Python API\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u7075\u6d3b\u6027\u548c\u5f3a\u5927\u7684\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u5728\u4efb\u4f55\u652f\u6301Python\u7684\u73af\u5883\u4e2d\u4f7f\u7528API\uff0c\u4f8b\u5982Jupyter Notebook\u3001Python\u811a\u672c\u7b49\u3002\u800c\u4e14\uff0cAPI\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u6ee1\u8db3\u5404\u79cd\u5730\u7406\u5904\u7406\u548c\u6570\u636e\u5206\u6790\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u901a\u8fc7Jupyter Notebook\u4f7f\u7528Python<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Jupyter Notebook\uff1a<\/strong> \u8981\u4f7f\u7528Jupyter Notebook\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86\u8be5\u5de5\u5177\u3002\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177\uff08\u5982Anaconda\u6216pip\uff09\u6765\u5b89\u88c5\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install -c conda-forge notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u542f\u52a8Jupyter Notebook\uff1a<\/strong> \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u6d4f\u89c8\u5668\u7a97\u53e3\uff0c\u663e\u793aJupyter Notebook\u7684\u4e3b\u754c\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u548c\u8fd0\u884cPython Notebook\uff1a<\/strong> \u5728Jupyter Notebook\u7684\u4e3b\u754c\u9762\u4e2d\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python Notebook\uff0c\u5e76\u5728\u5176\u4e2d\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728Notebook\u4e2d\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u6765\u5bfc\u5165ArcGIS Python API\u5e76\u8fdb\u884c\u5730\u7406\u5904\u7406\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from arcgis.gis import GIS<\/p>\n<p>from arcgis.features import FeatureLayer<\/p>\n<p>gis = GIS(&quot;https:\/\/www.arcgis.com&quot;, &quot;username&quot;, &quot;password&quot;)<\/p>\n<p>feature_layer = FeatureLayer(&quot;https:\/\/services.arcgis.com\/...\/FeatureServer\/0&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528Jupyter Notebook\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u76f4\u89c2\u7684\u754c\u9762\u548c\u4ea4\u4e92\u6027\u3002\u7528\u6237\u53ef\u4ee5\u5728Notebook\u4e2d\u9010\u6b65\u8f93\u5165\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u5e76\u5373\u65f6\u67e5\u770b\u7ed3\u679c\u3002\u8fd9\u5bf9\u4e8e\u6570\u636e\u5206\u6790\u548c\u5b9e\u9a8c\u6027\u5730\u7406\u5904\u7406\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528IDLE\u6216\u5176\u4ed6Python IDE<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Python IDE\uff1a<\/strong> \u8981\u4f7f\u7528IDLE\u6216\u5176\u4ed6Python IDE\uff08\u5982PyCharm\u3001VS Code\u7b49\uff09\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86\u8be5\u5de5\u5177\u3002\u53ef\u4ee5\u4ece\u76f8\u5173\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u8fd9\u4e9bIDE\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6ePython\u73af\u5883\uff1a<\/strong> \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u914d\u7f6ePython\u73af\u5883\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5ArcGIS Python API\u7b49\u5fc5\u8981\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728IDE\u7684\u8bbe\u7f6e\u4e2d\u6307\u5b9aPython\u89e3\u91ca\u5668\u548c\u5e93\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u548c\u8fd0\u884cPython\u811a\u672c\uff1a<\/strong> \u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728IDE\u4e2d\u7f16\u5199Python\u811a\u672c\uff0c\u5e76\u4f7f\u7528ArcGIS Python API\u8fdb\u884c\u5730\u7406\u5904\u7406\u548c\u6570\u636e\u5206\u6790\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728\u811a\u672c\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u6765\u5bfc\u5165API\u5e76\u6267\u884c\u5730\u7406\u5904\u7406\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from arcgis.gis import GIS<\/p>\n<p>from arcgis.features import FeatureLayer<\/p>\n<p>gis = GIS(&quot;https:\/\/www.arcgis.com&quot;, &quot;username&quot;, &quot;password&quot;)<\/p>\n<p>feature_layer = FeatureLayer(&quot;https:\/\/services.arcgis.com\/...\/FeatureServer\/0&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4f7f\u7528IDLE\u6216\u5176\u4ed6Python IDE\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u5f3a\u5927\u7684\u7f16\u8f91\u548c\u8c03\u8bd5\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u5728IDE\u4e2d\u65b9\u4fbf\u5730\u7f16\u5199\u3001\u8c03\u8bd5\u548c\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u5229\u7528IDE\u63d0\u4f9b\u7684\u5404\u79cd\u5de5\u5177\u6765\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001Python\u5728ArcGIS\u4e2d\u7684\u5e94\u7528\u5b9e\u4f8b<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5730\u7406\u5904\u7406\uff1a<\/strong> \u4f7f\u7528Python\u53ef\u4ee5\u8c03\u7528ArcGIS\u4e2d\u7684\u5404\u79cd\u5730\u7406\u5904\u7406\u5de5\u5177\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u811a\u672c\u6765\u6279\u91cf\u5904\u7406\u5730\u7406\u6570\u636e\u3001\u6267\u884c\u7a7a\u95f4\u5206\u6790\u3001\u751f\u6210\u5730\u56fe\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Python\u811a\u672c\u8c03\u7528\u7f13\u51b2\u533a\u5206\u6790\u5de5\u5177\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import arcpy<\/p>\n<h2><strong>\u8bbe\u7f6e\u5de5\u4f5c\u7a7a\u95f4<\/strong><\/h2>\n<p>arcpy.env.workspace = &quot;C:\/data&quot;<\/p>\n<h2><strong>\u8f93\u5165\u8981\u7d20\u7c7b\u548c\u8f93\u51fa\u8981\u7d20\u7c7b<\/strong><\/h2>\n<p>in_features = &quot;roads.shp&quot;<\/p>\n<p>out_feature_class = &quot;roads_buffer.shp&quot;<\/p>\n<h2><strong>\u6267\u884c\u7f13\u51b2\u533a\u5206\u6790<\/strong><\/h2>\n<p>arcpy.Buffer_analysis(in_features, out_feature_class, &quot;1000 Meters&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6570\u636e\u5206\u6790\uff1a<\/strong> \u4f7f\u7528Python\u53ef\u4ee5\u8fdb\u884c\u5404\u79cd\u5730\u7406\u6570\u636e\u5206\u6790\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528Pandas\u5e93\u6765\u5904\u7406\u548c\u5206\u6790\u5730\u7406\u6570\u636e\uff0c\u7ed3\u5408Matplotlib\u5e93\u751f\u6210\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Python\u811a\u672c\u8fdb\u884c\u6570\u636e\u5206\u6790\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<h2><strong>\u8bfb\u53d6\u5730\u7406\u6570\u636e<\/strong><\/h2>\n<p>data = pd.read_csv(&quot;C:\/data\/geodata.csv&quot;)<\/p>\n<h2><strong>\u5206\u6790\u6570\u636e<\/strong><\/h2>\n<p>summary = data.describe()<\/p>\n<h2><strong>\u751f\u6210\u6570\u636e\u53ef\u89c6\u5316\u56fe\u8868<\/strong><\/h2>\n<p>plt.figure(figsize=(10, 6))<\/p>\n<p>plt.plot(data[&quot;Longitude&quot;], data[&quot;Latitude&quot;], &quot;o&quot;)<\/p>\n<p>plt.title(&quot;Geographical Data Points&quot;)<\/p>\n<p>plt.xlabel(&quot;Longitude&quot;)<\/p>\n<p>plt.ylabel(&quot;Latitude&quot;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u81ea\u52a8\u5316\u5de5\u4f5c\u6d41\uff1a<\/strong> \u4f7f\u7528Python\u53ef\u4ee5\u81ea\u52a8\u5316ArcGIS\u4e2d\u7684\u5404\u79cd\u5de5\u4f5c\u6d41\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u7f16\u5199Python\u811a\u672c\u6765\u6279\u91cf\u6267\u884c\u5730\u56fe\u5bfc\u51fa\u3001\u6570\u636e\u66f4\u65b0\u3001\u62a5\u544a\u751f\u6210\u7b49\u4efb\u52a1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Python\u811a\u672c\u81ea\u52a8\u5316\u5730\u56fe\u5bfc\u51fa\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import arcpy<\/p>\n<h2><strong>\u8bbe\u7f6e\u5de5\u4f5c\u7a7a\u95f4<\/strong><\/h2>\n<p>arcpy.env.workspace = &quot;C:\/maps&quot;<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u5730\u56fe\u6587\u6863<\/strong><\/h2>\n<p>map_docs = arcpy.ListFiles(&quot;*.mxd&quot;)<\/p>\n<h2><strong>\u5faa\u73af\u5bfc\u51fa\u6bcf\u4e2a\u5730\u56fe\u6587\u6863<\/strong><\/h2>\n<p>for map_doc in map_docs:<\/p>\n<p>    mxd = arcpy.mapping.MapDocument(map_doc)<\/p>\n<p>    output_pdf = map_doc.replace(&quot;.mxd&quot;, &quot;.pdf&quot;)<\/p>\n<p>    arcpy.mapping.ExportToPDF(mxd, output_pdf)<\/p>\n<p>    del mxd<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001Python\u73af\u5883\u7ba1\u7406\u548c\u5305\u7ba1\u7406<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528Conda\u7ba1\u7406Python\u73af\u5883\uff1a<\/strong> Conda\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5305\u7ba1\u7406\u548c\u73af\u5883\u7ba1\u7406\u5de5\u5177\uff0c\u7279\u522b\u9002\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u548c\u6570\u636e\u5206\u6790\u3002\u53ef\u4ee5\u4f7f\u7528Conda\u521b\u5efa\u548c\u7ba1\u7406\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u786e\u4fdd\u73af\u5883\u4e2d\u7684\u5305\u7248\u672c\u517c\u5bb9\u4e14\u4e0d\u51b2\u7a81\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u73af\u5883\u5e76\u5b89\u88c5ArcGIS Python API\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create --name arcgis_env python=3.8<\/p>\n<p>conda activate arcgis_env<\/p>\n<p>conda install -c esri arcgis<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528Pip\u7ba1\u7406Python\u5305\uff1a<\/strong> Pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u5b89\u88c5\u3001\u5347\u7ea7\u548c\u5378\u8f7dPython\u5305\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5ArcGIS Python API\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install arcgis<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u540c\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528requirements.txt\u6587\u4ef6\u6765\u7ba1\u7406\u9879\u76ee\u6240\u9700\u7684\u6240\u6709\u5305\uff0c\u5e76\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u8fd9\u4e9b\u5305\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install -r requirements.txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u865a\u62df\u73af\u5883\u7684\u4f7f\u7528\uff1a<\/strong> \u865a\u62df\u73af\u5883\u5141\u8bb8\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u8fd0\u884c\u591a\u4e2a\u72ec\u7acb\u7684Python\u73af\u5883\u3002\u53ef\u4ee5\u4f7f\u7528venv\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\uff0c\u786e\u4fdd\u9879\u76ee\u4e4b\u95f4\u7684\u4f9d\u8d56\u4e0d\u51b2\u7a81\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u6fc0\u6d3b\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m venv arcgis_env<\/p>\n<p>source arcgis_env\/bin\/activate  # \u5728Windows\u4e0a\u4f7f\u7528arcgis_env\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e03\u3001Python\u4e0eArcPy\u7684\u96c6\u6210<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>ArcPy\u5e93\u7684\u4f7f\u7528\uff1a<\/strong> ArcPy\u662fArcGIS\u7684Python\u5e93\uff0c\u63d0\u4f9b\u4e86\u8bbf\u95eeArcGIS\u529f\u80fd\u7684\u63a5\u53e3\u3002\u53ef\u4ee5\u4f7f\u7528ArcPy\u5e93\u8c03\u7528\u5404\u79cd\u5730\u7406\u5904\u7406\u5de5\u5177\u3001\u64cd\u4f5c\u5730\u56fe\u6587\u6863\u3001\u7ba1\u7406\u5730\u7406\u6570\u636e\u7b49\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8c03\u7528\u7f13\u51b2\u533a\u5206\u6790\u5de5\u5177\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import arcpy<\/p>\n<h2><strong>\u8bbe\u7f6e\u5de5\u4f5c\u7a7a\u95f4<\/strong><\/h2>\n<p>arcpy.env.workspace = &quot;C:\/data&quot;<\/p>\n<h2><strong>\u8f93\u5165\u8981\u7d20\u7c7b\u548c\u8f93\u51fa\u8981\u7d20\u7c7b<\/strong><\/h2>\n<p>in_features = &quot;roads.shp&quot;<\/p>\n<p>out_feature_class = &quot;roads_buffer.shp&quot;<\/p>\n<h2><strong>\u6267\u884c\u7f13\u51b2\u533a\u5206\u6790<\/strong><\/h2>\n<p>arcpy.Buffer_analysis(in_features, out_feature_class, &quot;1000 Meters&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>ArcPy\u6a21\u5757\u548c\u7c7b\uff1a<\/strong> ArcPy\u5e93\u5305\u542b\u591a\u4e2a\u6a21\u5757\u548c\u7c7b\uff0c\u4f8b\u5982arcpy.mapping\u6a21\u5757\u7528\u4e8e\u64cd\u4f5c\u5730\u56fe\u6587\u6863\u548c\u56fe\u5c42\uff0carcpy.sa\u6a21\u5757\u7528\u4e8e\u7a7a\u95f4\u5206\u6790\uff0carcpy.da\u6a21\u5757\u7528\u4e8e\u6570\u636e\u8bbf\u95ee\u7b49\u3002\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5bfc\u5165\u548c\u4f7f\u7528\u8fd9\u4e9b\u6a21\u5757\u548c\u7c7b\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528arcpy.mapping\u6a21\u5757\u5bfc\u51fa\u5730\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import arcpy<\/p>\n<h2><strong>\u6253\u5f00\u5730\u56fe\u6587\u6863<\/strong><\/h2>\n<p>mxd = arcpy.mapping.MapDocument(&quot;C:\/maps\/map.mxd&quot;)<\/p>\n<h2><strong>\u5bfc\u51fa\u5730\u56fe\u4e3aPDF<\/strong><\/h2>\n<p>arcpy.mapping.ExportToPDF(mxd, &quot;C:\/maps\/map.pdf&quot;)<\/p>\n<h2><strong>\u91ca\u653e\u5730\u56fe\u6587\u6863\u5bf9\u8c61<\/strong><\/h2>\n<p>del mxd<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516b\u3001Python\u811a\u672c\u5de5\u5177\u548c\u6a21\u578b\u6784\u5efa<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c\u5de5\u5177\uff1a<\/strong> \u53ef\u4ee5\u5728ArcGIS\u4e2d\u521b\u5efaPython\u811a\u672c\u5de5\u5177\uff0c\u5c06Python\u811a\u672c\u5c01\u88c5\u4e3a\u5730\u7406\u5904\u7406\u5de5\u5177\uff0c\u4ee5\u4fbf\u5728ArcGIS\u754c\u9762\u4e2d\u4f7f\u7528\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c\u5de5\u5177\u6765\u6267\u884c\u7f13\u51b2\u533a\u5206\u6790\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import arcpy<\/p>\n<p>def m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n():<\/p>\n<p>    # \u83b7\u53d6\u5de5\u5177\u53c2\u6570<\/p>\n<p>    in_features = arcpy.GetParameterAsText(0)<\/p>\n<p>    out_feature_class = arcpy.GetParameterAsText(1)<\/p>\n<p>    buffer_distance = arcpy.GetParameterAsText(2)<\/p>\n<p>    # \u6267\u884c\u7f13\u51b2\u533a\u5206\u6790<\/p>\n<p>    arcpy.Buffer_analysis(in_features, out_feature_class, buffer_distance)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528ModelBuilder\u6784\u5efa\u6a21\u578b\uff1a<\/strong> ModelBuilder\u662fArcGIS\u4e2d\u7684\u53ef\u89c6\u5316\u7f16\u7a0b\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u5730\u7406\u5904\u7406\u5de5\u5177\u548cPython\u811a\u672c\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u6784\u5efa\u590d\u6742\u7684\u5de5\u4f5c\u6d41\u3002\u53ef\u4ee5\u5728ModelBuilder\u4e2d\u6dfb\u52a0Python\u811a\u672c\u5de5\u5177\uff0c\u5c06\u5176\u4e0e\u5176\u4ed6\u5730\u7406\u5904\u7406\u5de5\u5177\u8fde\u63a5\uff0c\u521b\u5efa\u81ea\u52a8\u5316\u5de5\u4f5c\u6d41\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5728ModelBuilder\u4e2d\u521b\u5efa\u4e00\u4e2a\u6a21\u578b\uff0c\u5305\u542b\u6570\u636e\u5bfc\u5165\u3001\u7f13\u51b2\u533a\u5206\u6790\u548c\u7ed3\u679c\u5bfc\u51fa\u7b49\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e5d\u3001Python\u4e0eArcGIS Online\u548cArcGIS Enterprise\u7684\u96c6\u6210<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528ArcGIS Online\uff1a<\/strong> ArcGIS Online\u662fEsri\u63d0\u4f9b\u7684\u57fa\u4e8e\u4e91\u7684\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\u5e73\u53f0\uff0c\u53ef\u4ee5\u901a\u8fc7ArcGIS Python API\u4e0e\u4e4b\u96c6\u6210\u3002\u53ef\u4ee5\u4f7f\u7528ArcGIS Python API\u8fde\u63a5\u5230ArcGIS Online\uff0c\u8bbf\u95ee\u548c\u7ba1\u7406\u5730\u7406\u6570\u636e\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8fde\u63a5\u5230ArcGIS Online\u5e76\u67e5\u8be2\u8981\u7d20\u56fe\u5c42\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from arcgis.gis import GIS<\/p>\n<p>from arcgis.features import FeatureLayer<\/p>\n<h2><strong>\u8fde\u63a5\u5230ArcGIS Online<\/strong><\/h2>\n<p>gis = GIS(&quot;https:\/\/www.arcgis.com&quot;, &quot;username&quot;, &quot;password&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u8981\u7d20\u56fe\u5c42<\/strong><\/h2>\n<p>feature_layer = FeatureLayer(&quot;https:\/\/services.arcgis.com\/...\/FeatureServer\/0&quot;)<\/p>\n<h2><strong>\u67e5\u8be2\u8981\u7d20<\/strong><\/h2>\n<p>features = feature_layer.query(where=&quot;1=1&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528ArcGIS Enterprise\uff1a<\/strong> ArcGIS Enterprise\u662fEsri\u63d0\u4f9b\u7684\u4f01\u4e1a\u7ea7\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\u5e73\u53f0\uff0c\u53ef\u4ee5\u901a\u8fc7ArcGIS Python API\u4e0e\u4e4b\u96c6\u6210\u3002\u53ef\u4ee5\u4f7f\u7528ArcGIS Python API\u8fde\u63a5\u5230ArcGIS Enterprise\uff0c\u8bbf\u95ee\u548c\u7ba1\u7406\u5730\u7406\u6570\u636e\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8fde\u63a5\u5230ArcGIS Enterprise\u5e76\u53d1\u5e03\u5730\u56fe\u670d\u52a1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from arcgis.gis import GIS<\/p>\n<p>from arcgis.mapping import WebMap<\/p>\n<h2><strong>\u8fde\u63a5\u5230ArcGIS Enterprise<\/strong><\/h2>\n<p>gis = GIS(&quot;https:\/\/enterprise.arcgis.com&quot;, &quot;username&quot;, &quot;password&quot;)<\/p>\n<h2><strong>\u521b\u5efaWeb\u5730\u56fe<\/strong><\/h2>\n<p>web_map = WebMap()<\/p>\n<h2><strong>\u6dfb\u52a0\u56fe\u5c42<\/strong><\/h2>\n<p>web_map.add_layer({&quot;url&quot;: &quot;https:\/\/services.arcgis.com\/...\/FeatureServer\/0&quot;})<\/p>\n<h2><strong>\u53d1\u5e03\u5730\u56fe\u670d\u52a1<\/strong><\/h2>\n<p>web_map.save({&quot;title&quot;: &quot;My Map Service&quot;, &quot;tags&quot;: &quot;map service&quot;, &quot;snippet&quot;: &quot;This is a map service.&quot;})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5341\u3001Python\u4e0e\u5176\u4ed6\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\u7684\u96c6\u6210<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4e0eQGIS\u7684\u96c6\u6210\uff1a<\/strong> QGIS\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\uff0c\u53ef\u4ee5\u901a\u8fc7PyQGIS\u4e0ePython\u96c6\u6210\u3002\u53ef\u4ee5\u4f7f\u7528PyQGIS\u7f16\u5199Python\u811a\u672c\uff0c\u8c03\u7528QGIS\u4e2d\u7684\u5404\u79cd\u529f\u80fd\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u52a0\u8f7d\u77e2\u91cf\u56fe\u5c42\u5e76\u8fdb\u884c\u7f13\u51b2\u533a\u5206\u6790\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from qgis.core import QgsVectorLayer, QgsProcessingFeedback, QgsProcessingContext<\/p>\n<p>import processing<\/p>\n<h2><strong>\u52a0\u8f7d\u77e2\u91cf\u56fe\u5c42<\/strong><\/h2>\n<p>vector_layer = QgsVectorLayer(&quot;C:\/data\/roads.shp&quot;, &quot;Roads&quot;, &quot;ogr&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u7f13\u51b2\u533a\u53c2\u6570<\/strong><\/h2>\n<p>buffer_params = {<\/p>\n<p>    &quot;INPUT&quot;: vector_layer,<\/p>\n<p>    &quot;DISTANCE&quot;: 1000,<\/p>\n<p>    &quot;OUTPUT&quot;: &quot;C:\/data\/roads_buffer.shp&quot;<\/p>\n<p>}<\/p>\n<h2><strong>\u6267\u884c\u7f13\u51b2\u533a\u5206\u6790<\/strong><\/h2>\n<p>processing.run(&quot;native:buffer&quot;, buffer_params, QgsProcessingContext(), QgsProcessingFeedback())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0eGDAL\u7684\u96c6\u6210\uff1a<\/strong> GDAL\u662f\u4e00\u4e2a\u7528\u4e8e\u5904\u7406\u5730\u7406\u7a7a\u95f4\u6570\u636e\u7684\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u7ed1\u5b9a\u4e0ePython\u96c6\u6210\u3002\u53ef\u4ee5\u4f7f\u7528GDAL\u8bfb\u53d6\u3001\u5199\u5165\u548c\u8f6c\u6362\u5730\u7406\u7a7a\u95f4\u6570\u636e\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8bfb\u53d6\u6805\u683c\u6570\u636e\u5e76\u8ba1\u7b97\u7edf\u8ba1\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from osgeo import gdal<\/p>\n<h2><strong>\u6253\u5f00\u6805\u683c\u6570\u636e<\/strong><\/h2>\n<p>raster = gdal.Open(&quot;C:\/data\/landcover.tif&quot;)<\/p>\n<h2><strong>\u8bfb\u53d6\u6ce2\u6bb5<\/strong><\/h2>\n<p>band = raster.GetRasterBand(1)<\/p>\n<h2><strong>\u8ba1\u7b97\u7edf\u8ba1\u4fe1\u606f<\/strong><\/h2>\n<p>stats = band.GetStatistics(True, True)<\/p>\n<h2><strong>\u8f93\u51fa\u7edf\u8ba1\u4fe1\u606f<\/strong><\/h2>\n<p>print(f&quot;Minimum: {stats[0]}, Maximum: {stats[1]}, Mean: {stats[2]}, Standard Deviation: {stats[3]}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0ePostGIS\u7684\u96c6\u6210\uff1a<\/strong> PostGIS\u662fPostgreSQL\u7684\u5730\u7406\u7a7a\u95f4\u6269\u5c55\uff0c\u53ef\u4ee5\u901a\u8fc7Psycopg2\u5e93\u4e0ePython\u96c6\u6210\u3002\u53ef\u4ee5\u4f7f\u7528Psycopg2\u8fde\u63a5\u5230PostGIS\u6570\u636e\u5e93\uff0c\u5e76\u6267\u884cSQL\u67e5\u8be2\u548c\u5730\u7406\u7a7a\u95f4\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u8fde\u63a5\u5230PostGIS\u6570\u636e\u5e93\u5e76\u67e5\u8be2\u5730\u7406\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import psycopg2<\/p>\n<h2><strong>\u8fde\u63a5\u5230PostGIS\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = psycopg2.connect(&quot;dbname=mydb user=myuser password=mypassword host=localhost port=5432&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u6e38\u6807<\/strong><\/h2>\n<p>cur = conn.cursor()<\/p>\n<h2><strong>\u6267\u884cSQL\u67e5\u8be2<\/strong><\/h2>\n<p>cur.execute(&quot;SELECT id, ST_AsText(geom) FROM mytable WHERE ST_Intersects(geom, ST_GeomFromText(&#39;POLYGON((...))&#39;, 4326))&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u67e5\u8be2\u7ed3\u679c<\/strong><\/h2>\n<p>rows = cur.fetchall()<\/p>\n<h2><strong>\u8f93\u51fa\u67e5\u8be2\u7ed3\u679c<\/strong><\/h2>\n<p>for row in rows:<\/p>\n<p>    print(row)<\/p>\n<h2><strong>\u5173\u95ed\u6e38\u6807\u548c\u8fde\u63a5<\/strong><\/h2>\n<p>cur.close()<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u5341\u4e00\u3001Python\u4e0e<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u5728\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\u4e2d\u7684\u5e94\u7528<\/p>\n<\/p>\n<ol>\n<li><strong>\u7a7a\u95f4\u6570\u636e\u7684\u9884\u5904\u7406\u548c\u7279\u5f81\u63d0\u53d6\uff1a<\/strong> \u5728\u8fdb\u884c\u673a\u5668\u5b66\u4e60\u5efa\u6a21\u4e4b\u524d\uff0c\u901a\u5e38\u9700\u8981\u5bf9\u7a7a\u95f4\u6570\u636e\u8fdb\u884c\u9884\u5904\u7406\u548c\u7279\u5f81\u63d0\u53d6\u3002\u53ef\u4ee5\u4f7f\u7528Python\u5e93\uff08\u5982Pandas\u3001NumPy\u7b49\uff09\u6765\u5904\u7406\u548c\u8f6c\u6362\u7a7a\u95f4\u6570\u636e\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<\/li>\n<\/ol>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728ArcGIS\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728ArcGIS\u4e2d\u8fd0\u884cPython\u811a\u672c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u8fdb\u884c\u3002\u60a8\u53ef\u4ee5\u5728ArcGIS Pro\u6216ArcMap\u7684Python\u7a97\u53e3\u4e2d\u76f4\u63a5\u8f93\u5165\u548c\u8fd0\u884c\u4ee3\u7801\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528ArcGIS\u7684ModelBuilder\u5de5\u5177\u6765\u521b\u5efa\u6a21\u578b\u5e76\u5728\u5176\u4e2d\u5d4c\u5165Python\u811a\u672c\u3002\u5bf9\u4e8e\u590d\u6742\u7684\u9879\u76ee\uff0c\u5efa\u8bae\u5728\u5916\u90e8IDE\uff08\u5982PyCharm\u6216Jupyter Notebook\uff09\u4e2d\u7f16\u5199\u811a\u672c\uff0c\u7136\u540e\u5728ArcGIS\u4e2d\u6267\u884c\u3002<\/p>\n<p><strong>ArcGIS\u652f\u6301\u54ea\u4e9bPython\u5e93\u548c\u6a21\u5757\uff1f<\/strong><br \/>ArcGIS\u4e3b\u8981\u652f\u6301ArcPy\u5e93\uff0c\u8fd9\u662f\u4e00\u4e2a\u7528\u4e8e\u5730\u7406\u5904\u7406\u548c\u7a7a\u95f4\u5206\u6790\u7684\u5f3a\u5927\u5de5\u5177\u3002\u9664\u4e86ArcPy\uff0c\u7528\u6237\u8fd8\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6Python\u5e93\uff0c\u5982Pandas\u3001NumPy\u548cMatplotlib\uff0c\u6765\u5904\u7406\u6570\u636e\u548c\u8fdb\u884c\u53ef\u89c6\u5316\u3002\u786e\u4fdd\u5b89\u88c5\u76f8\u5173\u5e93\uff0c\u5e76\u5728ArcGIS\u7684Python\u73af\u5883\u4e2d\u8fdb\u884c\u7ba1\u7406\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728ArcGIS\u4e2d\u89e3\u51b3Python\u73af\u5883\u95ee\u9898\uff1f<\/strong><br \/>\u5728ArcGIS\u4e2d\uff0c\u5982\u679c\u9047\u5230Python\u73af\u5883\u95ee\u9898\uff0c\u5982\u5e93\u65e0\u6cd5\u627e\u5230\u6216\u7248\u672c\u4e0d\u517c\u5bb9\uff0c\u5efa\u8bae\u68c0\u67e5\u5f53\u524d\u4f7f\u7528\u7684Python\u73af\u5883\u3002\u5728ArcGIS Pro\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u201cPython\u201d\u9009\u9879\u5361\u4e2d\u7684\u201c\u5305\u201d\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u3001\u66f4\u65b0\u6216\u5220\u9664\u5e93\u3002\u5982\u679c\u95ee\u9898\u4f9d\u7136\u5b58\u5728\uff0c\u53ef\u4ee5\u8003\u8651\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff0c\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u9879\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728ArcGIS\u4e2d\u6253\u5f00Python\u7684\u65b9\u6cd5\u6709\u591a\u4e2a\uff0c\u53ef\u4ee5\u901a\u8fc7ArcGIS Pro\u7684Python\u7a97\u53e3\u3001\u4f7f\u7528ArcGIS [&hellip;]","protected":false},"author":3,"featured_media":1167543,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1167533"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1167533"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1167533\/revisions"}],"predecessor-version":[{"id":1167545,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1167533\/revisions\/1167545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1167543"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1167533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1167533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1167533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}