{"id":1016,"date":"2017-10-16T12:01:59","date_gmt":"2017-10-16T04:01:59","guid":{"rendered":"http:\/\/www.siediyer.cn\/?p=1016"},"modified":"2017-10-16T12:02:00","modified_gmt":"2017-10-16T04:02:00","slug":"%e7%bb%99%e5%ae%9a%e7%bb%8f%e7%ba%ac%e5%ba%a6%e5%ae%9a%e4%bd%8d%e6%9f%90%e4%b8%aa%e5%9f%8e%e5%b8%82","status":"publish","type":"post","link":"https:\/\/www.siediyer.cn\/?p=1016","title":{"rendered":"\u7ed9\u5b9a\u7ecf\u7eac\u5ea6\u5b9a\u4f4d\u67d0\u4e2a\u57ce\u5e02"},"content":{"rendered":"<h1>\u65b9\u68481<\/h1>\n<p>\u901a\u8fc7GEO HASH\uff0c\u6293\u53d6\u6bcf\u4e2a\u683c\u5b50\u91cc\u7684\u70b9\u7684\u5730\u5740\u4fe1\u606f\uff0c\u7136\u540e\u628a\u8fd9\u4e2a\u5730\u5740\u4fe1\u606f\u4f5c\u4e3aGEO\u4e2d\u70b9\u5750\u6807\u7684\u4e00\u4e2a\u4fe1\u606f\uff0c\u5f53\u67e5\u8be2\u7ed9\u5b9a\u7ecf\u7eac\u5ea6\u662f\u5728\u54ea\u4e2a\u57ce\u5e02\u7684\u65f6\u5019\uff0c\u67e5\u8be2\u8fc7\u7a0b\u662f\u67e5\u8be2\u8ddd\u79bb\u8fd9\u4e2a\u7ecf\u7eac\u5ea6\u6700\u8fd1\u7684\u5e26\u6709\u5730\u5740\u7684\u70b9\uff0c\u8ba4\u4e3a\u7ed9\u5b9a\u7ecf\u7eac\u5ea6\u548c\u6700\u8fd1\u7684\u8fd9\u4e2a\u70b9\u662f\u540c\u4e00\u4e2a\u5730\u5740\u4e0b\u7684\u3002\u901a\u8fc7\u4e0d\u65ad\u5b8c\u5584GEO\u4e2d\u7684\u6bcf\u4e2a\u5750\u6807\u4e0b\u7684\u5730\u5740\u4fe1\u606f\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6574\u4e2a\u7cfb\u7edf\u7684\u7cbe\u5ea6\u3002\u8fd9\u79cd\u65b9\u6cd5\u76f8\u5f53\u4e8e\u4e00\u79cd\u95f4\u63a5\u83b7\u53d6\u7684\u65b9\u6cd5\u7684\u3002<\/p>\n<h1>\u65b9\u68482<\/h1>\n<p>\u6211\u4eec\u77e5\u9053\u6bcf\u4e2a\u5730\u533a\u662f\u6709\u4e00\u5b9a\u533a\u57df\u7684\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u4e00\u4e2a\u95ed\u5408\u7684\u591a\u8fb9\u5f62\uff0c\u5b9a\u4f4d\u57ce\u5e02\uff0c\u53ef\u4ee5\u7406\u89e3\u4e3a\u5224\u65ad\u67d0\u4e2a\u70b9\uff0c\u662f\u5426\u5728\u67d0\u4e2a\u533a\u57df\u5185\u3002<\/p>\n<h2>\u7b2c\u4e00\u70b9\uff1a\u5982\u4f55\u83b7\u53d6\u57ce\u5e02\u7684\u533a\u57df\u8fb9\u754c<\/h2>\n<p>\u5f88\u5e78\u8fd0\u7684\u662f\u767e\u5ea6\u5730\u56fe\u63d0\u4f9b\u4e86\u8fd9\u6837\u7684API<\/p>\n<pre class=\"lang:default decode:true \">&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;\r\n&lt;title&gt;\u83b7\u53d6\u5730\u533a\u8f6e\u5ed3\u7ebf&lt;\/title&gt;\r\n&lt;script type=\"text\/javascript\" src=\"http:\/\/api.map.baidu.com\/api?v=1.3\"&gt;\r\n&lt;\/script&gt;\r\n&lt;style type=\"text\/css\"&gt;\r\nbody{font-size:13px;margin:10px}\r\n#container{width:800px;height:500px;border:1px solid gray}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n&lt;br \/&gt;\r\n\u8f93\u5165\u7701\u3001\u76f4\u8f96\u5e02\u6216\u53bf\u540d\u79f0\uff1a&lt;input type=\"text\" id=\"districtName\" style=\"width:80px\" value=\"\u91cd\u5e86\u5e02\"&gt;\r\n&lt;input type=\"button\" onclick=\"getBoundary()\" value=\"\u83b7\u53d6\u8f6e\u5ed3\u7ebf\"&gt;\r\n\r\n&lt;script type=\"text\/javascript\"&gt;\r\nvar map = new BMap.Map(\"container\");\r\nmap.centerAndZoom(new BMap.Point(116.403765, 39.914850), 5);\r\nmap.addControl(new BMap.NavigationControl({type: BMAP_NAVIGATION_CONTROL_SMALL}));\r\nmap.enableScrollWheelZoom();\r\n\r\nfunction getBoundary(){       \r\n    var bdary = new BMap.Boundary();\r\n    var name = document.getElementById(\"districtName\").value;\r\n    bdary.get(name, function(rs){       \/\/\u83b7\u53d6\u884c\u653f\u533a\u57df\r\n        map.clearOverlays();        \/\/\u6e05\u9664\u5730\u56fe\u8986\u76d6\u7269       \r\n        var count = rs.boundaries.length; \/\/\u884c\u653f\u533a\u57df\u7684\u70b9\u6709\u591a\u5c11\u4e2a\r\n        for(var i = 0; i &lt; count; i++){\r\n            var ply = new BMap.Polygon(rs.boundaries[i], {strokeWeight: 2, strokeColor: \"#ff0000\"}); \/\/\u5efa\u7acb\u591a\u8fb9\u5f62\u8986\u76d6\u7269\r\n            map.addOverlay(ply);  \/\/\u6dfb\u52a0\u8986\u76d6\u7269\r\n            map.setViewport(ply.getPath());    \/\/\u8c03\u6574\u89c6\u91ce         \r\n        }                \r\n    });   \r\n}\r\n\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u8fd9\u6837\u7684API\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u53d8\u76f8\u83b7\u5f97\uff0c\u5927\u591a\u6570\u5730\u56fe\u63d0\u4f9b\u4e86\u901a\u8fc7\u7ecf\u7eac\u5ea6\u83b7\u53d6\u5730\u5740\u4fe1\u606f\u7684API\uff0c\u6211\u4eec\u53ef\u4ee5\u53d6\u4e00\u4e2a\u57ce\u5e02\u5185\u7684\u4e00\u70b9\uff0c\u7136\u540e\u5728\u57ce\u5e02\u5916\u5468\u56f4\u518d\u53d6N\u4e2a\u70b9\uff0c\u6211\u4eec\u901a\u8fc7\u4e8c\u5206\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u4e0d\u65ad\u903c\u8fd1\u8fb9\u754c<\/p>\n<p>PHP\u4ee3\u7801<\/p>\n<pre class=\"lang:default decode:true \">function border($city, $p1, $p2) {\r\n    $tpl = 'http:\/\/api.map.baidu.com\/geocoder\/v2\/?ak=\u4f60\u7684\u5e94\u7528key&amp;callback=renderReverse&amp;location=%s,%s&amp;output=json&amp;pois=1';\r\n    $i = 5;\r\n    while ($i&gt;0) {\r\n        $p1X = $p1[0];\r\n        $p1Y = $p1[1];\r\n        $p2X = $p2[0];\r\n        $p2Y = $p2[1];\r\n        $dX = abs($p1X - $p2X) \/ 2;\r\n        $dY = abs($p1Y - $p2Y) \/ 2;\r\n        $mX = min($p1X,$p2X) + $dX;\r\n        $mY = min($p1Y,$p2Y) + $dY;\r\n\r\n        $url = sprintf($tpl, $mY, $mX);\r\n        $content = rtrim(strstr(file_get_contents($url), \"{\", false), \")\");\r\n        $data = json_decode($content, true);\r\n        if (($data['result']['addressComponent']['city']) == $city) {\r\n            $p1[0] = $mX;\r\n            $p1[1] = $mY;\r\n        } else {\r\n            $p2[0] = $mX;\r\n            $p2[1] = $mY;\r\n        }\r\n        $i--;\r\n    }\r\n    return array($p1[0],$p1[1]);\r\n}<\/pre>\n<h2>\u7b2c\u4e8c\u70b9\uff1a\u77e5\u9053\u4e86\u533a\u57df\uff0c\u5982\u4f55\u77e5\u9053\u70b9\u5728\u533a\u57df\u5185<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1017\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/10\/121237009179946.png\" width=\"600\" height=\"381\" alt=\"\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/10\/121237009179946.png 600w, https:\/\/qiniu.shijitianchen.com\/2017\/10\/121237009179946-300x191.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1018\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/10\/121236168395779.jpg\" width=\"359\" height=\"242\" alt=\"\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/10\/121236168395779.jpg 359w, https:\/\/qiniu.shijitianchen.com\/2017\/10\/121236168395779-300x202.jpg 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/p>\n<p>\u5de6\u8fb9\u7684\u56fe\u662f\u4ece\u67d0\u4e2a\u70b9\u5411\u5f85\u68c0\u6d4b\u7684\u70b9\u5f15\u5c04\u7ebf\uff0c\u53f3\u8fb9\u7684\u56fe\u662f\u4ece\u5f85\u68c0\u6d4b\u7684\u70b9\uff0c\u5411\u67d0\u4e2a\u70b9\u5f15\u5c04\u7ebf\uff0c\u8fd9\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\uff0c\u5224\u65ad\u5c04\u7ebf\u4e0e\u95ed\u5408\u533a\u57df\u6bcf\u6761\u8fb9\u76f8\u4ea4\u7684\u6b21\u6570\uff0c\u5982\u679c\u662f\u5947\u6570\u6b21\u7684\u8bdd\uff0c\u53ef\u4ee5\u5224\u65ad\u70b9\u5728\u533a\u57df\u5185\uff0c\u5982\u679c\u662f\u5076\u6570\u6b21\u7684\u8bdd\uff0c\u53ef\u4ee5\u5224\u65ad\u70b9\u4e0d\u5728\u533a\u57df\u5185\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b9e\u9645\u7f16\u7a0b\u4e2d\uff0c\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u5b9e\u73b0\u8d77\u6765\u4f1a\u66f4\u7b80\u5355\u4e00\u4e9b\uff0c\u800c\u4e14\u6211\u4eec\u90fd\u662f\u5411X\u8f74\u7684\u6b63\u65b9\u5411\u5f15\u5c04\u7ebf\u4f1a\u66f4\u7b80\u5355\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u7b2c\u4e09\u70b9\uff1a\u5982\u4f55\u68c0\u6d4b\u67d0\u4e2a\u70b9\u6b63\u65b9\u5411\u7684\u5c04\u7ebf\u548c\u67d0\u6761\u8fb9\u76f8\u4ea4<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1019\" src=\"http:\/\/www.siediyer.cn\/wp-content\/uploads\/2017\/10\/121242434335505.jpg\" width=\"800\" height=\"975\" alt=\"\" srcset=\"https:\/\/qiniu.shijitianchen.com\/2017\/10\/121242434335505.jpg 800w, https:\/\/qiniu.shijitianchen.com\/2017\/10\/121242434335505-246x300.jpg 246w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>\u7ed9\u5b9a\u76f4\u7ebfP1P2\uff0c\u5224\u65ad\u70b9P\u5e73\u884c\u4e8eX\u8f74\u6b63\u65b9\u7684\u5c04\u7ebf\u662f\u5426\u4e0e\u76f4\u7ebfP1P2\u76f8\u4ea4\uff1f<\/p>\n<p>\u9996\u5148\uff0c\u6ee1\u8db3\u76f8\u4ea4\u7684\u6761\u4ef6\uff0c\u5fc5\u987bPy\u5939\u5728P1y\u548cP2y\u4e4b\u95f4\u3002<\/p>\n<p>\u5176\u6b21\uff0c\u6ee1\u8db3\u76f8\u4ea4\u7684\u6761\u4ef6\uff0cPx\u5c0f\u4e8eP1P2\u6700\u5927x\uff0c\u4e0d\u7136\u80af\u5b9a\u4e0d\u60f3\u4ea4\u4e86\u3002<\/p>\n<p>\u6700\u540e\uff0cP1,P2\u77e5\u9053\u8fd9\u4e24\u4e2a\u70b9\u53ef\u4ee5\u786e\u5b9a\u4e00\u6761\u76f4\u7ebf\u65b9\u7a0by=ax+b\uff0c\u7136\u540ep\u70b9\u6b63\u65b9\u7684\u5c04\u7ebf\u5b9e\u9645\u662fy=Py\u7684\u76f4\u7ebf\u65b9\u7a0b\uff0c\u8fd9\u4e24\u6761\u76f4\u7ebf\u53ef\u4ee5\u6c42\u51fa\u4ed6\u4eec\u7684\u7126\u70b9\u7684x\u5750\u6807xinters\u3002\u5982\u679cPx\u5c0f\u4e8exinters\u8bf4\u660e\u662f\u5728\u76f4\u7ebf\u7684y=ax+b\u7684\u5de6\u8fb9\uff0c\u5411\u53f3\u5f15\u5c04\u7ebf\u80af\u5b9a\u80fd\u76f8\u4ea4\uff0c\u5982\u679cPx\u5927\u4e8exinters\u8bf4\u660e\u5728y=ax+b\u7684\u53f3\u8fb9\uff0c\u5411\u53f3\u5f15\u5c04\u7ebf\u80af\u5b9a\u4e0d\u76f8\u4ea4\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u9644\u4e0a\u4e00\u6bb5\u5b9e\u73b0\u7684\u4ee3\u7801<\/p>\n<pre class=\"lang:default decode:true \">#define MIN(x,y) (x &lt; y ? x : y)\r\n#define MAX(x,y) (x &gt; y ? x : y)\r\n  \r\ntypedef struct {\r\n   double x,y;\r\n} Point;\r\n  \r\nint InsidePolygon(Point *polygon,int N,Point p)\r\n{\r\n  int counter = 0;\r\n  int i;\r\n  double xinters;\r\n  Point p1,p2;\r\n  \r\n  p1 = polygon[0];\r\n  for (i=1;i&lt;=N;i++) {\r\n    p2 = polygon[i % N];\r\n    if (p.y &gt; MIN(p1.y,p2.y)) { \/\/\u4f4e\r\n      if (p.y &lt;= MAX(p1.y,p2.y)) { \/\/\u9ad8\r\n        if (p.x &lt;= MAX(p1.x,p2.x)) { \/\/\u53f3\r\n          if (p1.y != p2.y) { \/\/\u7b80\u5355\u5ffd\u7565\u5e73\u884cX\u8f74\u8fd9\u79cd\u60c5\u51b5\r\n            xinters = (p.y-p1.y)*(p2.x-p1.x)\/(p2.y-p1.y)+p1.x; \/\/\u4ea4\u53c9\u70b9\u5750\u6807 \u53c2\u8003.\/media\/point-and-polygon\/xinters.jpg\r\n            if (p1.x == p2.x || p.x &lt;= xinters)\r\n              counter++;\r\n          }\r\n        }\r\n      }\r\n    }\r\n    p1 = p2;\r\n  }\r\n  \r\n  if (counter % 2 == 0)\r\n    return 0;\r\n  else\r\n    return 1;\r\n}<\/pre>\n<h2>\u7b2c\u56db\uff1a\u5e78\u8fd0\u7684\u662fJAVA\u4e2d\u7684awt.Polygon\u5df2\u7ecf\u5b9e\u73b0\u4e86\u7c7b\u4f3c\u7684\u7b97\u6cd5<\/h2>\n<p>\u4ee5\u4e0b\u4ee3\u7801\u5224\u65ad\u4e86\u4e00\u4e2a\u7ecf\u7eac\u5ea6\u662f\u5426\u5728\u5317\u4eac\u8303\u56f4\u5185<\/p>\n<pre class=\"lang:default decode:true \">import java.awt.*;\r\n\r\npublic class Main {\r\n\r\n    public static void init(Polygon p) {\r\n        String s = \"117.396814, 40.233095;117.360068, 40.242128;117.348757, 40.25027;117.343034, 40.283717;117.30242, 40.284012;117.300909, 40.298824;117.294971, 40.307248;117.280908, 40.31483;117.277872, 40.331475;117.281586, 40.338248;117.268763, 40.343838;117.248206, 40.376793;117.233105, 40.375358;117.230104, 40.381682;117.235062, 40.392322;117.241661, 40.395752;117.243127, 40.400548;117.246722, 40.40068;117.24604, 40.405045;117.238857, 40.410209;117.240581, 40.42306;117.256385, 40.435421;117.263364, 40.436067;117.26993, 40.447321;117.241196, 40.464298;117.242267, 40.475311;117.232341, 40.484311;117.234676, 40.48752;117.223574, 40.501212;117.215835, 40.502724;117.21653, 40.512643;117.220225, 40.518656;117.239555, 40.519506;117.245336, 40.523751;117.253813, 40.518445;117.266702, 40.525486;117.256848, 40.54366;117.259649, 40.547985;117.256124, 40.554638;117.272602, 40.564079;117.302711, 40.572713;117.317146, 40.582207;117.340905, 40.582418;117.356706, 40.586185;117.372601, 40.582034;117.382658, 40.572888;117.395929, 40.567374;117.410574, 40.579774;117.426571, 40.574504;117.436606, 40.584657;117.42995, 40.58783;117.420328, 40.612091;117.429118, 40.643382;117.478347, 40.653361;117.485398, 40.64184;117.507621, 40.642461;117.509516, 40.659031;117.513171, 40.660949;117.512283, 40.673448;117.501618, 40.68091;117.486462, 40.683865;117.471233, 40.679811;117.427458, 40.691901;117.413032, 40.691963;117.368422, 40.681015;117.352677, 40.680053;117.343188, 40.672822;117.343163, 40.669474;117.332062, 40.666479;117.298595, 40.665641;117.284975, 40.672219;117.267992, 40.687306;117.248559, 40.682887;117.237938, 40.691027;117.21279, 40.700633;117.189813, 40.703272;117.185509, 40.699216;117.173492, 40.704884;117.159189, 40.703082;117.123309, 40.706232;117.11851, 40.713341;117.090641, 40.708002;117.056273, 40.706007;117.037346, 40.698128;117.010825, 40.702995;116.971399, 40.715332;116.972824, 40.719631;116.951579, 40.733725;116.947612, 40.745358;116.933105, 40.750454;116.929846, 40.757856;116.934815, 40.762214;116.930179, 40.779446;116.904581, 40.783162;116.901081, 40.788008;116.9026, 40.800071;116.88808, 40.809295;116.888235, 40.820112;116.881718, 40.827765;116.867501, 40.831665;116.862506, 40.841264;116.844057, 40.847245;116.829961, 40.848436;116.827445, 40.853933;116.819235, 40.853821;116.812193, 40.846273;116.80869, 40.85693;116.789081, 40.879637;116.77733, 40.887135;116.764859, 40.889985;116.765735, 40.896678;116.743541, 40.903681;116.737051, 40.903223;116.732415, 40.909594;116.720191, 40.915779;116.722334, 40.924405;116.73105, 40.935302;116.724433, 40.941791;116.712821, 40.939941;116.697791, 40.956023;116.693814, 40.967528;116.684172, 40.977679;116.684106, 40.982014;116.691199, 40.988235;116.691729, 41.007364;116.698209, 41.014096;116.697524, 41.018573;116.702854, 41.021883;116.704409, 41.031402;116.696054, 41.050272;116.690283, 41.047187;116.665317, 41.056873;116.655365, 41.063919;116.637532, 41.066884;116.632524, 41.061892;116.622608, 41.059055;116.624713, 41.054896;116.620421, 41.04299;116.628376, 41.0337;116.62829, 41.022061;116.622062, 41.0105;116.621672, 40.992318;116.606371, 40.981254;116.592437, 40.985128;116.580618, 40.993771;116.566631, 40.998804;116.56466, 40.994409;116.554092, 40.993979;116.547776, 40.996659;116.525911, 40.987794;116.523141, 40.981751;116.499718, 40.984453;116.492126, 40.988346;116.480946, 40.983933;116.470491, 40.990227;116.462585, 40.984177;116.454523, 40.960213;116.468624, 40.938999;116.474211, 40.93707;116.481905, 40.917902;116.483361, 40.905498;116.480853, 40.903074;116.443685, 40.90498;116.437039, 40.909232;116.421842, 40.906839;116.408434, 40.911863;116.398376, 40.92057;116.377851, 40.949215;116.372863, 40.949316;116.366048, 40.941941;116.347659, 40.936639;116.341021, 40.9254;116.340967, 40.91152;116.388424, 40.869752;116.396076, 40.868438;116.397954, 40.861524;116.411794, 40.847151;116.412806, 40.839748;116.444768, 40.824186;116.449148, 40.812842;116.458652, 40.803974;116.465447, 40.802591;116.472163, 40.77826;116.460539, 40.771806;116.445402, 40.772914;116.422367, 40.768351;116.416833, 40.785757;116.401677, 40.78488;116.373736, 40.776837;116.328394, 40.778196;116.320514, 40.77693;116.314111, 40.769582;116.317666, 40.760475;116.314075, 40.758484;116.294132, 40.770103;116.280562, 40.769739;116.275753, 40.781289;116.254416, 40.797832;116.241679, 40.789088;116.242438, 40.781394;116.236838, 40.768522;116.240245, 40.764807;116.221101, 40.750547;116.219936, 40.746062;116.226137, 40.739108;116.216877, 40.727078;116.209974, 40.72149;116.193057, 40.724782;116.18734, 40.718765;116.177616, 40.702363;116.180134, 40.699151;116.171808, 40.674123;116.164609, 40.669972;116.148927, 40.673475;116.138716, 40.661807;116.120445, 40.654743;116.118173, 40.649776;116.126964, 40.631189;116.117788, 40.62193;116.068027, 40.615224;116.037281, 40.603575;116.026374, 40.604705;116.01256, 40.594188;116.00943, 40.581671;115.988979, 40.584777;115.979101, 40.607208;115.96029, 40.607401;115.950341, 40.617487;115.934286, 40.619091;115.916134, 40.624756;115.894762, 40.602501;115.834129, 40.593641;115.82805, 40.569572;115.820068, 40.563255;115.805593, 40.563806;115.797891, 40.567662;115.767764, 40.545073;115.761164, 40.545717;115.742637, 40.510394;115.752305, 40.498003;115.783837, 40.492361;115.775733, 40.468534;115.778708, 40.455699;115.788186, 40.444804;115.803563, 40.436957;115.811505, 40.426348;115.824703, 40.392614;115.839213, 40.384772;115.855604, 40.38265;115.87134, 40.368466;115.882848, 40.364071;115.895453, 40.367279;115.910131, 40.366321;115.91565, 40.373277;115.92271, 40.373176;115.930506, 40.348471;115.929014, 40.342954;115.93938, 40.324907;115.949202, 40.320196;115.950679, 40.31592;115.946689, 40.310072;115.952985, 40.294974;115.95687, 40.293726;115.962316, 40.28308;115.967807, 40.28117;115.967703, 40.276763;115.974803, 40.269453;115.96956, 40.263582;115.939616, 40.261757;115.925633, 40.254556;115.917889, 40.241488;115.905256, 40.241696;115.890773, 40.22004;115.894544, 40.215076;115.878751, 40.193072;115.86747, 40.19034;115.850978, 40.173889;115.859884, 40.154416;115.813286, 40.159262;115.800328, 40.174545;115.796151, 40.18475;115.779416, 40.182207;115.774742, 40.172296;115.763447, 40.169641;115.756972, 40.159365;115.761798, 40.150631;115.754547, 40.140404;115.731648, 40.134635;115.693943, 40.144939;115.661502, 40.133591;115.657429, 40.123404;115.618554, 40.122766;115.61325, 40.120591;115.61212, 40.109824;115.607844, 40.10545;115.610083, 40.099374;115.587407, 40.101838;115.582502, 40.108779;115.559105, 40.087639;115.549021, 40.082009;115.534603, 40.082349;115.516148, 40.071128;115.513656, 40.063479;115.49734, 40.056354;115.479551, 40.039915;115.462648, 40.033699;115.459211, 40.029466;115.454533, 39.999598;115.450072, 40.000977;115.440883, 39.995542;115.43257, 39.985449;115.430282, 39.961629;115.433244, 39.956319;115.448393, 39.958579;115.482655, 39.943021;115.496416, 39.927586;115.513516, 39.919226;115.527724, 39.907377;115.529448, 39.904259;115.51576, 39.889913;115.517443, 39.886911;115.535997, 39.882121;115.530323, 39.874847;115.527983, 39.86375;115.517405, 39.850512;115.532551, 39.836925;115.551154, 39.832822;115.575643, 39.819741;115.57307, 39.811205;115.558665, 39.801297;115.550738, 39.802418;115.519505, 39.794138;115.513357, 39.788984;115.498847, 39.802132;115.490144, 39.804462;115.466597, 39.789538;115.446208, 39.789696;115.443016, 39.782414;115.4537, 39.755596;115.475508, 39.746881;115.489207, 39.748202;115.498946, 39.744467;115.494841, 39.737957;115.498926, 39.707306;115.506367, 39.69717;115.495458, 39.687104;115.49821, 39.674617;115.485294, 39.661638;115.485203, 39.656314;115.513505, 39.65776;115.522393, 39.648146;115.528856, 39.645963;115.525992, 39.618943;115.539326, 39.617612;115.552049, 39.625147;115.575098, 39.604458;115.580881, 39.602542;115.57802, 39.598252;115.580937, 39.597404;115.592675, 39.595736;115.606081, 39.605443;115.624996, 39.609891;115.640839, 39.603874;115.640124, 39.60979;115.648167, 39.609304;115.650382, 39.605047;115.664199, 39.607415;115.677061, 39.614593;115.687469, 39.602859;115.6977, 39.597042;115.700636, 39.58446;115.698616, 39.572297;115.724345, 39.567191;115.733957, 39.55403;115.744881, 39.549176;115.750469, 39.530171;115.758146, 39.518671;115.769417, 39.52097;115.774597, 39.513389;115.77468, 39.521173;115.803517, 39.516067;115.833646, 39.518631;115.834908, 39.547445;115.852755, 39.549069;115.853237, 39.557078;115.859607, 39.558462;115.872222, 39.553433;115.893877, 39.55684;115.893426, 39.562061;115.89959, 39.562647;115.900299, 39.57279;115.914709, 39.575423;115.918661, 39.579418;115.92096, 39.5894;115.91514, 39.59102;115.913687, 39.602606;115.919764, 39.605797;115.927621, 39.603682;115.927525, 39.600123;115.93517, 39.59979;115.936548, 39.590961;115.950787, 39.582123;115.956732, 39.572271;115.964618, 39.57154;115.983172, 39.576154;115.983491, 39.600071;115.991092, 39.600501;115.998195, 39.599442;115.999942, 39.589146;116.003687, 39.588679;116.001695, 39.582687;116.014635, 39.583917;116.022136, 39.593854;116.043035, 39.57876;116.07333, 39.577713;116.110362, 39.580779;116.111984, 39.576795;116.153802, 39.575452;116.16104, 39.586423;116.200314, 39.588234;116.207352, 39.58384;116.227953, 39.584402;116.245105, 39.556047;116.250727, 39.552413;116.251984, 39.521643;116.258316, 39.516687;116.261105, 39.50889;116.282528, 39.501232;116.285552, 39.497833;116.310498, 39.493163;116.325583, 39.480138;116.332267, 39.468477;116.349029, 39.458592;116.351422, 39.453985;116.371229, 39.453886;116.372291, 39.457582;116.383324, 39.459122;116.394203, 39.456088;116.399532, 39.458963;116.425853, 39.454582;116.436799, 39.445587;116.444783, 39.448582;116.448654, 39.447369;116.458375, 39.453186;116.462321, 39.46309;116.456546, 39.468347;116.454885, 39.482176;116.44748, 39.492161;116.427339, 39.502878;116.413425, 39.529626;116.425291, 39.528906;116.432281, 39.522346;116.441316, 39.522359;116.446318, 39.524486;116.449053, 39.535027;116.483584, 39.545471;116.484288, 39.555351;116.51236, 39.561538;116.533535, 39.579411;116.530868, 39.603113;116.561077, 39.604456;116.575397, 39.60992;116.574035, 39.615511;116.578352, 39.625892;116.597606, 39.62995;116.608882, 39.627922;116.60958, 39.617675;116.618347, 39.614326;116.63956, 39.598435;116.649575, 39.602253;116.65341, 39.612935;116.701393, 39.602494;116.710341, 39.59463;116.735224, 39.599557;116.712803, 39.615639;116.712707, 39.620278;116.732272, 39.622677;116.770397, 39.621126;116.781618, 39.611405;116.786732, 39.600158;116.794329, 39.602738;116.792869, 39.609761;116.798272, 39.610925;116.798806, 39.616774;116.835365, 39.623318;116.847796, 39.629981;116.837352, 39.642124;116.837919, 39.648702;116.857622, 39.661133;116.858348, 39.670383;116.862345, 39.673679;116.890055, 39.681869;116.899041, 39.67916;116.913065, 39.682652;116.912129, 39.692889;116.895367, 39.709769;116.889375, 39.722799;116.896226, 39.731878;116.905895, 39.732316;116.918338, 39.737685;116.915713, 39.755851;116.905956, 39.765245;116.917067, 39.769397;116.926504, 39.785708;116.954922, 39.787312;116.958916, 39.788953;116.957802, 39.793369;116.947889, 39.802187;116.942966, 39.801267;116.941163, 39.807497;116.944047, 39.811272;116.934897, 39.8194;116.934864, 39.836027;116.921582, 39.8546;116.914208, 39.858458;116.910419, 39.856768;116.908704, 39.849417;116.914744, 39.836888;116.906097, 39.838156;116.892248, 39.85166;116.865868, 39.864936;116.858785, 39.876295;116.826594, 39.895721;116.810909, 39.894968;116.798184, 39.891052;116.790891, 39.904278;116.787847, 39.924116;116.790425, 39.947352;116.784383, 39.957745;116.785533, 39.962352;116.781118, 39.966493;116.778104, 39.962551;116.768888, 39.965436;116.766651, 39.963757;116.763082, 39.967772;116.774479, 39.991807;116.782163, 39.999264;116.777743, 40.020054;116.79169, 40.04063;116.808115, 40.035326;116.812623, 40.039475;116.829879, 40.034153;116.830104, 40.053132;116.856134, 40.058213;116.856655, 40.06071;116.862424, 40.059915;116.879125, 40.046781;116.887003, 40.052001;116.897445, 40.05203;116.91645, 40.058756;116.921103, 40.058581;116.924633, 40.052961;116.929155, 40.052608;116.937167, 40.060357;116.945078, 40.053844;116.949071, 40.054797;116.953609, 40.047448;116.968858, 40.057487;116.97638, 40.054388;116.979592, 40.047527;116.9842, 40.045447;117.01239, 40.038834;117.03162, 40.038702;117.045767, 40.055848;117.060658, 40.061359;117.062142, 40.064898;117.088476, 40.070829;117.095952, 40.076216;117.119763, 40.078627;117.142575, 40.070338;117.16233, 40.075069;117.167983, 40.081988;117.183281, 40.07842;117.191574, 40.091165;117.219451, 40.102784;117.230842, 40.100735;117.230798, 40.104818;117.256558, 40.125811;117.264635, 40.118738;117.282491, 40.119351;117.294419, 40.127966;117.305696, 40.128324;117.318401, 40.145199;117.351763, 40.148592;117.364739, 40.166702;117.360039, 40.179331;117.371849, 40.184583;117.39733, 40.184087;117.411835, 40.190451;117.413853, 40.193758;117.410394, 40.194931;117.402432, 40.192313;117.386786, 40.198355;117.387165, 40.205991;117.394824, 40.209093;117.395258, 40.212225;117.385567, 40.214483;117.38483, 40.223684;117.399491, 40.227136;117.396814, 40.233095\";\r\n        for ( String t : s.split(\";\")) {\r\n            int x = (int) (Float.parseFloat(t.split(\",\")[0]) * 1000);\r\n            int y = (int) (Float.parseFloat(t.split(\",\")[1]) * 1000);\r\n            p.addPoint(x, y);\r\n        }\r\n    }\r\n\r\n    public static boolean contains(Polygon p, float x, float y) {\r\n        return p.contains(x * 1000, y * 1000);\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        Polygon p = new Polygon();\r\n        init(p);\r\n        contains(p, 116.270313f, 39.909622f);\r\n        contains(p, 115.590763f, 40.032598f);\r\n        contains(p, 115.903517f ,40.875831f);\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u68481 \u901a\u8fc7GEO HASH\uff0c\u6293\u53d6\u6bcf\u4e2a\u683c\u5b50\u91cc\u7684\u70b9\u7684\u5730\u5740\u4fe1\u606f\uff0c\u7136\u540e\u628a\u8fd9\u4e2a\u5730\u5740\u4fe1\u606f\u4f5c\u4e3aGEO\u4e2d\u70b9\u5750\u6807\u7684\u4e00\u4e2a\u4fe1\u606f\uff0c\u5f53 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1017,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[69,70],"class_list":["post-1016","post","type-post","status-publish","format-standard","hentry","category-android","tag-gis","tag-70"],"_links":{"self":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1016"}],"version-history":[{"count":1,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":1020,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions\/1020"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/media\/1017"}],"wp:attachment":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}