{"id":204978,"date":"2025-05-29T17:13:15","date_gmt":"2025-05-29T09:13:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/204978\/"},"modified":"2025-05-29T17:13:15","modified_gmt":"2025-05-29T09:13:15","slug":"%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96%e6%89%b9%e9%87%8f%e7%bb%8f%e7%ba%ac%e5%ba%a6%e8%b7%9d%e7%a6%bb%e8%ae%a1%e7%ae%97%ef%bc%8c%e5%b0%86-17-%e5%88%86%e9%92%9f%e7%9a%84%e5%a4%84%e7%90%86%e6%97%b6","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/204978\/","title":{"rendered":"\u5982\u4f55\u4f18\u5316\u6279\u91cf\u7ecf\u7eac\u5ea6\u8ddd\u79bb\u8ba1\u7b97\uff0c\u5c06 17 \u5206\u949f\u7684\u5904\u7406\u65f6\u95f4\u7f29\u77ed\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f18\u5316\u6279\u91cf\u7ecf\u7eac\u5ea6\u8ddd\u79bb\u8ba1\u7b97\uff0c\u5c06 17 \u5206\u949f\u7684\u5904\u7406\u65f6\u95f4\u7f29\u77ed\uff1f<\/h1>\n<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732104032673dcf6077934.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>\u6279\u91cf\u7ecf\u7eac\u5ea6\u8ddd\u79bb\u8ba1\u7b97\u4f18\u5316<\/strong><\/p>\n<p>\u9700\u8981\u8ba1\u7b97\u5927\u91cf\u7ecf\u7eac\u5ea6\u70b9\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u901f\u5ea6\u8f83\u6162\u3002\u672c\u95ee\u7b54\u65e8\u5728\u63d0\u4f9b\u4f18\u5316\u5efa\u8bae\uff0c\u4ee5\u7f29\u77ed\u5904\u7406\u65f6\u95f4\u3002<\/p>\n<p><strong>\u539f\u59cb\u95ee\u9898\uff1a<\/strong><\/p>\n<ul>\n<li>\u9700\u6c42\uff1a\u627e\u51fa a \u8868\u4e2d\u7684\u70b9\u4e0e b \u8868\u4e2d\u8ddd\u79bb\u4e0d\u8d85\u8fc7 2km \u7684\u70b9\u3002<\/li>\n<li>\u6570\u636e\uff1aa \u8868 10 \u4e07\u884c\uff0cb \u8868 25 \u4e07\u884c\u3002<\/li>\n<li>\u539f\u59cb\u4ee3\u7801\u8017\u65f6\uff1a17 \u5206\u949f\u3002<\/li>\n<\/ul>\n<p><strong>\u4f18\u5316\u5efa\u8bae\uff1a<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528\u77e9\u9635\u8ba1\u7b97\uff1a<\/strong><\/p>\n<p>\u901a\u8fc7\u4f7f\u7528 scipy.spatial.distance_matrix \u51fd\u6570\uff0c\u53ef\u4ee5\u4e00\u6b21\u6027\u8ba1\u7b97\u6240\u6709\u70b9\u5bf9\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<p><strong>2. \u7f29\u5c0f\u641c\u7d22\u8303\u56f4\uff1a<\/strong><\/p>\n<p>\u6839\u636e\u9700\u6c42\uff0c\u53ea\u9700\u627e\u51fa\u8ddd\u79bb 2km \u8303\u56f4\u5185\u7684\u70b9\u3002\u53ef\u4ee5\u6839\u636e\u6700\u5927\u641c\u7d22\u534a\u5f84\u7f29\u5c0f b \u8868\u7684\u641c\u7d22\u8303\u56f4\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u6700\u5927\u641c\u7d22\u534a\u5f84\u4e3a 15km\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u7f29\u5c0f\u641c\u7d22\u8303\u56f4\uff1a<\/p>\n<pre>df4_lon_max = df51.longitude.max() + 15\ndf4_lon_min = df51.longitude.min() - 15\ndf4_lat_max = df51.latitude.max() + 15\ndf4_lat_min = df51.latitude.min() - 15\n\ndf41 = df4[(df4['longitude'] &gt; df4_lon_min) &amp; (df4['longitude'] &lt; df4_lon_max) &amp; (df4['latitude'] &lt; df4_lat_max) &amp; (df4['latitude'] &gt; df4_lat_min)]<\/pre>\n<p><strong>3. \u5e76\u884c\u8ba1\u7b97\uff1a<\/strong><\/p>\n<p>\u5982\u679c\u4ee3\u7801\u6027\u80fd\u5141\u8bb8\u5e76\u884c\u5316\uff0c\u53ef\u4ee5\u5229\u7528\u591a\u6838 cpu \u5e76\u884c\u8ba1\u7b97\uff0c\u8fdb\u4e00\u6b65\u52a0\u5feb\u901f\u5ea6\u3002<\/p>\n<p><strong>4. \u54c8\u5f17\u8f9b\u516c\u5f0f\u4f18\u5316\uff1a<\/strong><\/p>\n<p>\u5728\u8ba1\u7b97\u8ddd\u79bb\u65f6\uff0c\u4f7f\u7528\u4e86\u54c8\u5f17\u8f9b\u516c\u5f0f\u3002\u6b64\u516c\u5f0f\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\u8fdb\u884c\u90e8\u5206\u4f18\u5316\uff1a<\/p>\n<ul>\n<li>\u5c06\u534a\u7403\u5f27\u5ea6\u516c\u5f0f\uff08hav\uff09\u8ba1\u7b97\u5916\u79fb\u5faa\u73af\uff1a<\/li>\n<\/ul>\n<pre>def hav(theta):\n  return 0.5 * (1 - cos(theta))\n\ndef fun3(df5, df4, group=20, interval=0.15, dis=2000):\n  ...\n  hav_Latitude_x = hav(radians(df45['Latitude_x']))\n  hav_Longitude_x = hav(radians(df45['Longitude_x']))\n  hav_Latitude_y = hav(radians(df45['Latitude_y']))\n  hav_Longitude_y = hav(radians(df45['Longitude_y']))\n  # ...<\/pre>\n<p><strong>5. \u9650\u5236\u7ed3\u679c\u6570\u91cf\uff1a<\/strong><\/p>\n<p>\u6839\u636e\u9700\u6c42\uff0c\u53ea\u9700\u627e\u51fa\u8ddd\u79bb\u4e0d\u8d85\u8fc7 2km \u7684\u70b9\u3002\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u6700\u5927\u7ed3\u679c\u6570\u91cf\uff0c\u5982 100 \u4e2a\uff0c\u4ee5\u907f\u514d\u7a0b\u5e8f\u8ba1\u7b97\u8fc7\u591a\u4e0d\u5fc5\u8981\u7684\u8ddd\u79bb\u3002<\/p>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300a\u5982\u4f55\u4f18\u5316\u6279\u91cf\u7ecf\u7eac\u5ea6\u8ddd\u79bb\u8ba1\u7b97\uff0c\u5c06 17 \u5206\u949f\u7684\u5904\u7406\u65f6\u95f4\u7f29\u77ed\uff1f\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03\u6587\u7ae0\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f18\u5316\u6279\u91cf\u7ecf\u7eac\u5ea6\u8ddd\u79bb\u8ba1\u7b97\uff0c\u5c06 &#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-204978","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=204978"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/204978\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=204978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=204978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=204978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}