{"id":991666,"date":"2024-12-27T08:31:04","date_gmt":"2024-12-27T00:31:04","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/991666.html"},"modified":"2024-12-27T08:31:07","modified_gmt":"2024-12-27T00:31:07","slug":"python%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85geos","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/991666.html","title":{"rendered":"python\u5982\u4f55\u5feb\u901f\u5b89\u88c5geos"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065844\/ca3a7020-bec1-47e9-bf32-e318654fb04f.webp\" alt=\"python\u5982\u4f55\u5feb\u901f\u5b89\u88c5geos\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u5feb\u901f\u5b89\u88c5GEOS\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt-get\u6216brew\uff09\u3001\u901a\u8fc7conda\u5b89\u88c5\u3001\u4f7f\u7528\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u8fd9\u4e9b\u65b9\u6cd5\u80fd\u591f\u5e2e\u52a9\u7528\u6237\u5728\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u9ad8\u6548\u5730\u914d\u7f6eGEOS\u73af\u5883\u3002<\/strong>\u5176\u4e2d\uff0c\u6700\u63a8\u8350\u7684\u65b9\u6cd5\u662f\u5728Linux\u7cfb\u7edf\u4e0a\u4f7f\u7528\u5305\u7ba1\u7406\u5668apt-get\uff0c\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u7b80\u5355\uff0c\u800c\u4e14\u53ef\u4ee5\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u5173\u7cfb\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u51e0\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5GEOS<\/p>\n<\/p>\n<p><p>\u5305\u7ba1\u7406\u5668\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5feb\u901f\u5b89\u88c5\u5404\u79cd\u8f6f\u4ef6\u5305\u3002\u5bf9\u4e8eLinux\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528apt-get\u6216yum\u6765\u5b89\u88c5GEOS\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5728Ubuntu\u6216Debian\u4e0a\u4f7f\u7528apt-get\u5b89\u88c5<\/li>\n<\/ol>\n<p><p>\u5728Ubuntu\u6216Debian\u4e0a\uff0capt-get\u662f\u4e00\u4e2a\u975e\u5e38\u5e38\u7528\u7684\u5305\u7ba1\u7406\u5668\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5GEOS\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt-get update<\/p>\n<p>sudo apt-get install libgeos-dev<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e24\u884c\u547d\u4ee4\u5206\u522b\u7528\u4e8e\u66f4\u65b0\u5305\u5217\u8868\u548c\u5b89\u88c5GEOS\u5f00\u53d1\u5e93\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0cGEOS\u7684\u5934\u6587\u4ef6\u548c\u5e93\u6587\u4ef6\u5c06\u88ab\u5b89\u88c5\u5230\u7cfb\u7edf\u4e2d\uff0cPython\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u8fd9\u4e9b\u6587\u4ef6\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u5728CentOS\u6216Red Hat\u4e0a\u4f7f\u7528yum\u5b89\u88c5<\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8eCentOS\u6216Red Hat\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528yum\u6765\u5b89\u88c5GEOS\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo yum install geos geos-devel<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0eapt-get\u7c7b\u4f3c\uff0cyum\u4e5f\u4f1a\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u5173\u7cfb\u5e76\u5b89\u88c5GEOS\u7684\u5f00\u53d1\u5e93\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u5728macOS\u4e0a\u4f7f\u7528Homebrew\u5b89\u88c5<\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8emacOS\u7528\u6237\uff0cHomebrew\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684\u5305\u7ba1\u7406\u5668\u3002\u4f7f\u7528Homebrew\u5b89\u88c5GEOS\u975e\u5e38\u7b80\u5355\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">brew install geos<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Homebrew\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u548c\u7f16\u8bd1GEOS\uff0c\u5e76\u5b89\u88c5\u5230\u7cfb\u7edf\u4e2d\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u901a\u8fc7Conda\u5b89\u88c5GEOS<\/p>\n<\/p>\n<p><p>Conda\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5305\u7ba1\u7406\u7cfb\u7edf\u548c\u73af\u5883\u7ba1\u7406\u7cfb\u7edf\uff0c\u5c24\u5176\u9002\u7528\u4e8ePython\u73af\u5883\u7684\u7ba1\u7406\u3002Conda\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u5b89\u88c5GEOS\uff0c\u65e0\u9700\u624b\u52a8\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Anaconda\u6216Miniconda<\/li>\n<\/ol>\n<p><p>\u9996\u5148\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86Anaconda\u6216Miniconda\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u4eceAnaconda\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u5e76\u6309\u7167\u8bf4\u660e\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u521b\u5efa\u5e76\u6fc0\u6d3b\u4e00\u4e2a\u65b0\u7684Conda\u73af\u5883\uff08\u53ef\u9009\uff09<\/li>\n<\/ol>\n<p><p>\u4e3a\u4e86\u907f\u514d\u5bf9\u73b0\u6709\u73af\u5883\u9020\u6210\u5f71\u54cd\uff0c\u53ef\u4ee5\u9009\u62e9\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Conda\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda create -n geos_env python=3.8<\/p>\n<p>conda activate geos_env<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u4f7f\u7528Conda\u5b89\u88c5GEOS<\/li>\n<\/ol>\n<p><p>\u5728\u6fc0\u6d3b\u7684Conda\u73af\u5883\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5GEOS\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">conda install -c conda-forge geos<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Conda\u5c06\u4ececonda-forge\u9891\u9053\u4e0b\u8f7d\u5e76\u5b89\u88c5GEOS\u53ca\u5176\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u67d0\u4e9b\u7528\u6237\uff0c\u53ef\u80fd\u5e0c\u671b\u907f\u514d\u7f16\u8bd1\u6e90\u4ee3\u7801\u5e26\u6765\u7684\u590d\u6742\u6027\uff0c\u6b64\u65f6\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7dGEOS\u7684\u4e8c\u8fdb\u5236\u53d1\u884c\u7248<\/li>\n<\/ol>\n<p><p>\u8bbf\u95eeGEOS\u7684\u5b98\u65b9\u7f51\u7ad9\u6216\u5176\u4ed6\u53ef\u4fe1\u7684\u7b2c\u4e09\u65b9\u6e90\uff0c\u4e0b\u8f7d\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684GEOS\u4e8c\u8fdb\u5236\u53d1\u884c\u7248\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u89e3\u538b\u5e76\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/li>\n<\/ol>\n<p><p>\u89e3\u538b\u4e0b\u8f7d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5305\uff0c\u5e76\u5c06\u5176\u8def\u5f84\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u4f8b\u5982\uff0c\u5728Linux\u4e2d\u53ef\u4ee5\u7f16\u8f91<code>~\/.bashrc<\/code>\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">export PATH=&quot;\/path\/to\/geos\/bin:$PATH&quot;<\/p>\n<p>export LD_LIBRARY_PATH=&quot;\/path\/to\/geos\/lib:$LD_LIBRARY_PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201c\u7cfb\u7edf\u5c5e\u6027 -&gt; \u73af\u5883\u53d8\u91cf\u201d\u754c\u9762\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u9a8c\u8bc1\u5b89\u88c5<\/li>\n<\/ol>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u9a8c\u8bc1GEOS\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">geos-config --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u80fd\u591f\u6b63\u786e\u8f93\u51faGEOS\u7684\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u7ed3\u5408Python\u4f7f\u7528GEOS<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u4f7f\u7528GEOS\u76f8\u5173\u529f\u80fd\u3002\u6700\u5e38\u89c1\u7684\u4f7f\u7528\u573a\u666f\u662f\u901a\u8fc7Shapely\u5e93\u8c03\u7528GEOS\u7684\u529f\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Shapely<\/li>\n<\/ol>\n<p><p>\u5728Python\u73af\u5883\u4e2d\u5b89\u88c5Shapely\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install shapely<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Shapely\u8fdb\u884c\u7a7a\u95f4\u64cd\u4f5c<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528Shapely\u548cGEOS\u8fdb\u884c\u7a7a\u95f4\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from shapely.geometry import Point, Polygon<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u70b9<\/strong><\/h2>\n<p>point = Point(1.0, 1.0)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u591a\u8fb9\u5f62<\/strong><\/h2>\n<p>polygon = Polygon([(0, 0), (2, 0), (2, 2), (0, 2)])<\/p>\n<h2><strong>\u5224\u65ad\u70b9\u662f\u5426\u5728\u591a\u8fb9\u5f62\u5185<\/strong><\/h2>\n<p>is_within = point.within(polygon)<\/p>\n<p>print(f&quot;Point is within polygon: {is_within}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0a\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4e2a\u70b9\u548c\u4e00\u4e2a\u591a\u8fb9\u5f62\uff0c\u5e76\u5224\u65ad\u70b9\u662f\u5426\u4f4d\u4e8e\u591a\u8fb9\u5f62\u5185\u90e8\u3002\u8fd9\u79cd\u7a7a\u95f4\u64cd\u4f5c\u4f9d\u8d56\u4e8eGEOS\u5e93\u63d0\u4f9b\u7684\u5e95\u5c42\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u89e3\u51b3\u53ef\u80fd\u51fa\u73b0\u7684\u95ee\u9898<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u548c\u4f7f\u7528GEOS\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u627e\u4e0d\u5230GEOS\u5e93\u6587\u4ef6<\/li>\n<\/ol>\n<p><p>\u5982\u679c\u5728\u4f7f\u7528Shapely\u65f6\u9047\u5230\u9519\u8bef\u63d0\u793a\u201c\u627e\u4e0d\u5230GEOS\u5e93\u6587\u4ef6\u201d\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u4e0d\u6b63\u786e\u3002\u8bf7\u786e\u4fddGEOS\u7684\u5e93\u6587\u4ef6\u8def\u5f84\u5df2\u6b63\u786e\u6dfb\u52a0\u5230<code>LD_LIBRARY_PATH<\/code>\uff08Linux\uff09\u6216<code>PATH<\/code>\uff08Windows\uff09\u4e2d\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u7248\u672c\u4e0d\u517c\u5bb9<\/li>\n<\/ol>\n<p><p>\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cShapely\u53ef\u80fd\u4e0e\u7cfb\u7edf\u4e0a\u5b89\u88c5\u7684GEOS\u7248\u672c\u4e0d\u517c\u5bb9\u3002\u6b64\u65f6\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u66f4\u65b0Shapely\u6216GEOS\u5230\u6700\u65b0\u7248\u672c\uff0c\u6216\u8005\u5728Conda\u73af\u5883\u4e2d\u8fdb\u884c\u9694\u79bb\u5b89\u88c5\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u7f16\u8bd1\u9519\u8bef<\/li>\n<\/ol>\n<p><p>\u5728\u7f16\u8bd1GEOS\u6e90\u4ee3\u7801\u65f6\uff0c\u5982\u679c\u9047\u5230\u7f16\u8bd1\u9519\u8bef\uff0c\u901a\u5e38\u662f\u7531\u4e8e\u7f3a\u5c11\u5fc5\u8981\u7684\u5f00\u53d1\u5de5\u5177\u6216\u5e93\u3002\u8bf7\u786e\u4fdd\u5df2\u5b89\u88c5\u7f16\u8bd1\u5de5\u5177\u94fe\uff08\u5982GCC\u3001Make\uff09\u548c\u5fc5\u8981\u7684\u5e93\uff08\u5982CMake\uff09\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u7ed3\u8bba<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u591a\u79cd\u5728Python\u4e2d\u5feb\u901f\u5b89\u88c5GEOS\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u662f\u5728Linux\u3001macOS\u8fd8\u662fWindows\u7cfb\u7edf\u4e0a\uff0c\u90fd\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5b89\u88c5\u65b9\u5f0f\u3002\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u3001Conda\u6216\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u90fd\u80fd\u6709\u6548\u5730\u7b80\u5316\u5b89\u88c5\u8fc7\u7a0b\uff0c\u5e76\u786e\u4fdd\u7cfb\u7edf\u4e0a\u6240\u9700\u7684\u4f9d\u8d56\u9879\u5f97\u4ee5\u6b63\u786e\u914d\u7f6e\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u4f60\u5feb\u901f\u642d\u5efa\u8d77Python\u548cGEOS\u7684\u5de5\u4f5c\u73af\u5883\uff0c\u4ee5\u4fbf\u4e8e\u8fdb\u884c\u5730\u7406\u7a7a\u95f4\u6570\u636e\u7684\u5904\u7406\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u73af\u5883\u4e2d\u5feb\u901f\u5b89\u88c5GEOS\u5e93\uff1f<\/strong><br \/>\u8981\u5728Python\u73af\u5883\u4e2d\u5feb\u901f\u5b89\u88c5GEOS\u5e93\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5de5\u5177\u5982<code>conda<\/code>\u6216<code>pip<\/code>\u3002\u5982\u679c\u4f7f\u7528<code>conda<\/code>\uff0c\u53ea\u9700\u5728\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<code>conda install -c conda-forge geos<\/code>\u3002\u5982\u679c\u4f7f\u7528<code>pip<\/code>\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u76f8\u5e94\u7684Python\u7ed1\u5b9a\u6765\u5b8c\u6210\uff1a<code>pip install geos<\/code>\u3002\u786e\u4fdd\u60a8\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86\u76f8\u5e94\u7684\u4f9d\u8d56\u9879\uff0c\u4ee5\u907f\u514d\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u7684\u9519\u8bef\u3002<\/p>\n<p><strong>\u5b89\u88c5GEOS\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4f9d\u8d56\u9879\uff1f<\/strong><br \/>\u5728\u5b89\u88c5GEOS\u4e4b\u524d\uff0c\u68c0\u67e5\u60a8\u7684\u7cfb\u7edf\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86C\u7f16\u8bd1\u5668\uff0c\u56e0\u4e3aGEOS\u662f\u7528C\u8bed\u8a00\u7f16\u5199\u7684\u3002\u5bf9\u4e8eLinux\u7528\u6237\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u5b89\u88c5<code>build-essential<\/code>\u548c\u5176\u4ed6\u76f8\u5173\u7684\u5f00\u53d1\u5e93\u3002Windows\u7528\u6237\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7<code>conda<\/code>\u73af\u5883\u6765\u7b80\u5316\u5b89\u88c5\u8fc7\u7a0b\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u60a8\u7684Python\u7248\u672c\u4e0e\u6240\u9009\u7684GEOS\u7248\u672c\u517c\u5bb9\u3002<\/p>\n<p><strong>\u5b89\u88c5GEOS\u540e\u5982\u4f55\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1f<\/strong><br \/>\u5728\u5b89\u88c5GEOS\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728Python\u4e2d\u5bfc\u5165\u76f8\u5e94\u7684\u6a21\u5757\u6765\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u4ee3\u7801\uff1a<code>import osgeo; print(osgeo.__version__)<\/code>\u3002\u5982\u679c\u6ca1\u6709\u9519\u8bef\u6d88\u606f\uff0c\u5e76\u4e14\u80fd\u591f\u6b63\u786e\u8f93\u51fa\u7248\u672c\u53f7\uff0c\u8bf4\u660eGEOS\u5df2\u6210\u529f\u5b89\u88c5\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u8fd0\u884c\u4e00\u4e9b\u7b80\u5355\u7684GEOS\u51fd\u6570\u6765\u6d4b\u8bd5\u5176\u529f\u80fd\u662f\u5426\u6b63\u5e38\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u5feb\u901f\u5b89\u88c5GEOS\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\uff1a\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt-get\u6216brew\uff09\u3001\u901a\u8fc7cond [&hellip;]","protected":false},"author":3,"featured_media":991683,"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\/991666"}],"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=991666"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991666\/revisions"}],"predecessor-version":[{"id":991687,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/991666\/revisions\/991687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/991683"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=991666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=991666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=991666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}