{"id":28,"date":"2021-04-28T10:56:00","date_gmt":"2021-04-28T02:56:00","guid":{"rendered":"http:\/\/iot.osvlabs.com\/?p=28"},"modified":"2021-09-02T14:35:24","modified_gmt":"2021-09-02T06:35:24","slug":"%e8%bd%a6%e8%81%94%e7%bd%91%e9%a1%b9%e7%9b%ae%e5%b8%b8%e8%a7%81%e5%8a%9f%e8%83%bd%e7%9a%84%e5%bc%80%e5%8f%91%e8%a6%81%e7%82%b9","status":"publish","type":"post","link":"https:\/\/blog.osvlabs.com\/?p=28","title":{"rendered":"\u8f66\u8054\u7f51\u9879\u76ee\u5e38\u89c1\u529f\u80fd\u7684\u5f00\u53d1\u8981\u70b9"},"content":{"rendered":"\n<h2>\u884c\u9a76\u8f68\u8ff9<\/h2>\n\n\n\n<p><strong>\u7ecf\u7eac\u5ea6\u5750\u6807\u79cd\u7c7b\uff1a<\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u5e38\u7528\u7684\u5730\u56feapi\u5750\u6807\u7cfb\u6709<strong>wgs84\u5750\u6807\u7cfb<\/strong>\uff0c<strong>gcj02\u5750\u6807\u7cfb<\/strong>\uff0c<strong>bd09\u5750\u6807\u7cfb<\/strong>\u3002<\/p>\n\n\n\n<p>wgs\u5750\u6807\u7cfb\u662f\u56fd\u9645\u4e0a\u901a\u7528\u7684\u5750\u6807\u7cfb\uff0c\u4e5f\u79f0\u5730\u7403\u5750\u6807\u7cfb\uff0cgps\u548c\u5317\u6597\u7cfb\u7edf\u90fd\u4f7f\u7528\u7684\u662fwgs\u5750\u6807\u7cfb\u3002\u8c37\u6b4c\u5730\u56fe\u4f7f\u7528\u7684\u662fwgs\u5750\u6807\u7cfb\uff08\u4e2d\u56fd\u90e8\u5206\u9664\u5916\uff09\uff0copenstreetmap\u4f7f\u7528\u7684\u4e5f\u662f\u8fd9\u79cd\u5750\u6807\u7cfb<\/p>\n\n\n\n<p>gcj02\u5750\u6807\u7cfb\u662f\u7531\u4e2d\u56fd\u56fd\u5bb6\u6d4b\u7ed8\u5c40\u5236\u8ba2\u7684\u5730\u7406\u4fe1\u606f\u7cfb\u7edf\u7684\u5750\u6807\u7cfb\u7edf\u3002\u7531WGS84\u5750\u6807\u7cfb\u7ecf\u52a0\u5bc6\u540e\u7684\u5750\u6807\u7cfb\uff0c\u4e5f\u79f0\u706b\u661f\u5750\u6807\u7cfb\uff0c\u8c37\u6b4c\u4e2d\u56fd\u5730\u56fe\u3001\u641c\u641c\u4e2d\u56fd\u5730\u56fe\u3001\u9ad8\u5fb7\u5730\u56fe\u91c7\u7528\u7684\u662fGCJ02\u5730\u7406\u5750\u6807\u7cfb\u3002<\/p>\n\n\n\n<p>BD09\u5750\u6807\u7cfb\uff1a\u5373\u767e\u5ea6\u5750\u6807\u7cfb\uff0cGCJ02\u5750\u6807\u7cfb\u7ecf\u52a0\u5bc6\u540e\u7684\u5750\u6807\u7cfb\uff0c\u7531\u767e\u5ea6\u516c\u53f8\u72ec\u521b\uff0c\u767e\u5ea6\u5730\u56fe\u4f7f\u7528\u7684\u5c31\u662f\u8fd9\u4e2a\u5750\u6807\u7cfb\u3002<br><\/p>\n\n\n\n<p>https:\/\/blog.csdn.net\/qq_39426934\/article\/details\/90241941<\/p>\n\n\n\n<p>\u5750\u6807\u7cfb\u7684\u8f6c\u6362\uff1a<\/p>\n\n\n\n<ul><li>\u901a\u8fc7\u5730\u56fe\u5b98\u65b9\u7684API\u8fdb\u884c\u8f6c\u6362\uff0c\u4f18\u70b9\u662f\u8f6c\u6362\u51c6\u786e\uff0c\u7f3a\u70b9\u662f\u9650\u5236\u6b21\u6570\uff0c\u6279\u91cf\u8f6c\u6362\u6162\uff0c\u9002\u7528\u4e8e\u5f00\u53d1\u9636\u6bb5<\/li><li>\u901a\u8fc7\u4ee3\u7801\u6839\u636e\u536b\u661f\u692d\u7403\u5750\u6807\u6295\u5f71\u5230\u5e73\u9762\u5730\u56fe\u5750\u6807\u7cfb\u7684\u6295\u5f71\u56e0\u5b50\u548c\u692d\u7403\u7684\u504f\u5fc3\u7387\uff0c\u8ba1\u7b97\u5e76\u8f6c\u6362\uff0c\u524d\u7aef\u8f6c\u6362\u8282\u7ea6\u8d44\u6e90\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">export default {\nPI: 3.14159265358979324,  \nx_pi: 3.14159265358979324 * 3000.0 \/ 180.0,  \ndelta: function (lat, lon)  \n{  \n    var a = 6378245.0; \/\/  a: \u536b\u661f\u692d\u7403\u5750\u6807\u6295\u5f71\u5230\u5e73\u9762\u5730\u56fe\u5750\u6807\u7cfb\u7684\u6295\u5f71\u56e0\u5b50\u3002  \n    var ee = 0.00669342162296594323; \/\/  ee: \u692d\u7403\u7684\u504f\u5fc3\u7387\u3002  \n    var dLat = this.transformLat(lon - 105.0, lat - 35.0);  \n    var dLon = this.transformLon(lon - 105.0, lat - 35.0);  \n    var radLat = lat \/ 180.0 * this.PI;  \n    var magic = Math.sin(radLat);  \n    magic = 1 - ee * magic * magic;  \n    var sqrtMagic = Math.sqrt(magic);  \n    dLat = (dLat * 180.0) \/ ((a * (1 - ee)) \/ (magic * sqrtMagic) * this.PI);  \n    dLon = (dLon * 180.0) \/ (a \/ sqrtMagic * Math.cos(radLat) * this.PI);  \n    return { 'lat': dLat, 'lon': dLon };  \n},  \n\/\/ WGS-84 to BD-09\nwgs_to_bd: function (wgsLat, wgsLon) {\n    var gc = this.gcj_encrypt(wgsLat, wgsLon);\n    return this.bd_encrypt(gc.lat, gc.lon);\n},\n\/\/ WGS-84 to GCJ-02  \ngcj_encrypt: function (wgsLat, wgsLon)  \n{  \n    if (this.outOfChina(wgsLat, wgsLon))  \n        return { 'lat': wgsLat, 'lon': wgsLon };  \n\n    var d = this.delta(wgsLat, wgsLon);  \n    return { 'lat': wgsLat + d.lat, 'lon': wgsLon + d.lon };  \n},  \n\/\/ GCJ-02 to WGS-84  \ngcj_decrypt: function (gcjLat, gcjLon)  \n{  \n    if (this.outOfChina(gcjLat, gcjLon))  \n        return { 'lat': gcjLat, 'lon': gcjLon };  \n\n    var d = this.delta(gcjLat, gcjLon);  \n    return { 'lat': gcjLat - d.lat, 'lon': gcjLon - d.lon };  \n},  \n\/\/ GCJ-02 to WGS-84 exactly  \ngcj_decrypt_exact: function (gcjLat, gcjLon)  \n{  \n    var initDelta = 0.01;  \n    var threshold = 0.000000001;  \n    var dLat = initDelta, dLon = initDelta;  \n    var mLat = gcjLat - dLat, mLon = gcjLon - dLon;  \n    var pLat = gcjLat + dLat, pLon = gcjLon + dLon;  \n    var wgsLat, wgsLon, i = 0;  \n    while (1)  \n    {  \n        wgsLat = (mLat + pLat) \/ 2;  \n        wgsLon = (mLon + pLon) \/ 2;  \n        var tmp = this.gcj_encrypt(wgsLat, wgsLon)  \n        dLat = tmp.lat - gcjLat;  \n        dLon = tmp.lon - gcjLon;  \n        if ((Math.abs(dLat) &amp;lt; threshold) &amp;amp;&amp;amp; (Math.abs(dLon) &amp;lt; threshold))  \n            break;  \n\n        if (dLat &amp;gt; 0) pLat = wgsLat; else mLat = wgsLat;  \n        if (dLon &amp;gt; 0) pLon = wgsLon; else mLon = wgsLon;  \n\n        if (++i &amp;gt; 10000) break;  \n    }  \n    \/\/console.log(i);  \n    return { 'lat': wgsLat, 'lon': wgsLon };  \n},  \n\/\/ GCJ-02 to BD-09  \nbd_encrypt: function (gcjLat, gcjLon)  \n{  \n    var x = gcjLon, y = gcjLat;  \n    var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.x_pi);  \n    var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.x_pi);  \n    var bdLon = z * Math.cos(theta) + 0.0065;  \n    var bdLat = z * Math.sin(theta) + 0.006;  \n    return { 'lat': bdLat, 'lon': bdLon };  \n},  \n\/\/ BD-09 to GCJ-02  \nbd_decrypt: function (bdLat, bdLon)  \n{  \n    var x = bdLon - 0.0065, y = bdLat - 0.006;  \n    var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * this.x_pi);  \n    var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * this.x_pi);  \n    var gcjLon = z * Math.cos(theta);  \n    var gcjLat = z * Math.sin(theta);  \n    return { 'lat': gcjLat, 'lon': gcjLon };  \n},  \n\/\/ WGS-84 to Web mercator  \n\/\/ mercatorLat -&amp;gt; y mercatorLon -&amp;gt; x  \nmercator_encrypt: function (wgsLat, wgsLon)  \n{  \n    var x = wgsLon * 20037508.34 \/ 180.;  \n    var y = Math.log(Math.tan((90. + wgsLat) * this.PI \/ 360.)) \/ (this.PI \/ 180.);  \n    y = y * 20037508.34 \/ 180.;  \n    return { 'lat': y, 'lon': x };  \n},  \n\/\/ Web mercator to WGS-84  \n\/\/ mercatorLat -&amp;gt; y mercatorLon -&amp;gt; x  \nmercator_decrypt: function (mercatorLat, mercatorLon)  \n{  \n    var x = mercatorLon \/ 20037508.34 * 180.;  \n    var y = mercatorLat \/ 20037508.34 * 180.;  \n    y = 180 \/ this.PI * (2 * Math.atan(Math.exp(y * this.PI \/ 180.)) - this.PI \/ 2);  \n    return { 'lat': y, 'lon': x };  \n},  \n\/\/ two point's distance  \ndistance: function (latA, lonA, latB, lonB)  \n{  \n    var earthR = 6371000.;  \n    var x = Math.cos(latA * this.PI \/ 180.) * Math.cos(latB * this.PI \/ 180.) * Math.cos((lonA - lonB) * this.PI \/ 180);  \n    var y = Math.sin(latA * this.PI \/ 180.) * Math.sin(latB * this.PI \/ 180.);  \n    var s = x + y;  \n    if (s &amp;gt; 1) s = 1;  \n    if (s &amp;lt; -1) s = -1;  \n    var alpha = Math.acos(s);  \n    var distance = alpha * earthR;  \n    return distance;  \n},  \noutOfChina: function (lat, lon)  \n{  \n    if (lon &amp;lt; 72.004 || lon &amp;gt; 137.8347)  \n        return true;  \n    if (lat &amp;lt; 0.8293 || lat &amp;gt; 55.8271)  \n        return true;  \n    return false;  \n},  \ntransformLat: function (x, y)  \n{  \n    var ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));  \n    ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 \/ 3.0;  \n    ret += (20.0 * Math.sin(y * this.PI) + 40.0 * Math.sin(y \/ 3.0 * this.PI)) * 2.0 \/ 3.0;  \n    ret += (160.0 * Math.sin(y \/ 12.0 * this.PI) + 320 * Math.sin(y * this.PI \/ 30.0)) * 2.0 \/ 3.0;  \n    return ret;  \n},  \ntransformLon: function (x, y)  \n{  \n    var ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));  \n    ret += (20.0 * Math.sin(6.0 * x * this.PI) + 20.0 * Math.sin(2.0 * x * this.PI)) * 2.0 \/ 3.0;  \n    ret += (20.0 * Math.sin(x * this.PI) + 40.0 * Math.sin(x \/ 3.0 * this.PI)) * 2.0 \/ 3.0;  \n    ret += (150.0 * Math.sin(x \/ 12.0 * this.PI) + 300.0 * Math.sin(x \/ 30.0 * this.PI)) * 2.0 \/ 3.0;  \n    return ret;  \n}  \n};<\/pre>\n\n\n\n<h2>\u7535\u5b50\u56f4\u680f<\/h2>\n\n\n\n<p><strong>\u4f7f\u7528\u57fa\u4e8epostgresql\u7684\u6570\u636e\u5e93\u63d2\u4ef6\uff1aPostGIS<\/strong><\/p>\n\n\n\n<p>PostGIS\u662f\u5bf9\u8c61\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7cfb\u7edfPostgreSQL\u7684\u4e00\u4e2a\u6269\u5c55\uff0cPostGIS\u63d0\u4f9b\u5982\u4e0b\u7a7a\u95f4\u4fe1\u606f\u670d\u52a1\u529f\u80fd:\u7a7a\u95f4\u5bf9\u8c61\u3001\u7a7a\u95f4\u7d22\u5f15\u3001\u7a7a\u95f4\u64cd\u4f5c\u51fd\u6570\u548c\u7a7a\u95f4\u64cd\u4f5c\u7b26\u3002\u56e0\u4e3aPostGIS\u662f\u5efa\u7acb\u5728PostgreSQL\u4e4b\u4e0a\u7684\uff0c\u6240\u4ee5PostGIS\u81ea\u52a8\u7ee7\u627f\u4e86\u91cd\u8981\u7684&#8221;\u4f01\u4e1a\u7ea7&#8221;\u7279\u6027\u4ee5\u53ca\u5f00\u653e\u6e90\u4ee3\u7801\u7684\u6807\u51c6\u3002\u53ef\u4ee5\u8bf4PostGIS\u4ec5\u4ec5\u53ea\u662fPostgreSQL\u7684\u4e00\u4e2a\u63d2\u4ef6\uff0c\u4f46\u662f\u5b83\u5c06PostgreSQL\u53d8\u6210\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u7a7a\u95f4\u6570\u636e\u5e93\uff01<\/p>\n\n\n\n<p>\u56f4\u680f\u8ba1\u7b97\u53ef\u4ee5\u57fa\u4e8e\u6570\u636e\u5e93\u7a7a\u95f4\u51fd\u6570 ST_Witin<\/p>\n\n\n\n<p>ST_Within(geometry A, geometry B)\uff1a<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp; \u5982\u679c\u51e0\u4f55A\u5b8c\u5168\u5728\u51e0\u4f55B\u5185\uff0c\u5219\u8fd4\u56detrue\u3002\u4e3a\u4e86\u4f7f\u8fd9\u4e2a\u51fd\u6570\u6709\u610f\u4e49\uff0c\u6e90\u51e0\u4f55\u56fe\u5f62\u5fc5\u987b\u5177\u6709\u76f8\u540c\u7684\u5750\u6807\u6295\u5f71\uff0c\u5177\u6709\u76f8\u540c\u7684SRID\u3002\u5982\u679c(a,B)\u4e2d\u7684ST\u4e3a\u771f\uff0c\u4e14(B, a)\u4e2d\u7684ST\u4e3a\u771f\uff0c\u5219\u8ba4\u4e3a\u8fd9\u4e24\u4e2a\u51e0\u4f55\u56fe\u5f62\u5728\u7a7a\u95f4\u4e0a\u662f\u76f8\u7b49\u7684\u3002<\/p>\n\n\n\n<p>&nbsp;&nbsp;\u53c2\u8003\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/postgis.net\/docs\/manual-2.5\/reference.html\">https:\/\/postgis.net\/docs\/manual-2.5\/reference.html<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/digoal\/blog\/blob\/master\/201708\/20170803_01.md\">https:\/\/github.com\/digoal\/blog\/blob\/master\/201708\/20170803_01.md<\/a><\/p>\n\n\n\n<p><strong>\u901a\u8fc7PHP\u4ee3\u7801\u8ba1\u7b97\u7535\u5b50\u56f4\u680f<\/strong><\/p>\n\n\n\n<p>\u63a8\u8350\u5305\uff1aphpgeo<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"925\" height=\"808\" src=\"http:\/\/www.osvlabs.com\/blog\/wp-content\/uploads\/2021\/04\/QQ\u622a\u56fe20210428112928.png\" alt=\"\" class=\"wp-image-41\" srcset=\"https:\/\/blog.osvlabs.com\/wp-content\/uploads\/2021\/04\/QQ\u622a\u56fe20210428112928.png 925w, https:\/\/blog.osvlabs.com\/wp-content\/uploads\/2021\/04\/QQ\u622a\u56fe20210428112928-300x262.png 300w, https:\/\/blog.osvlabs.com\/wp-content\/uploads\/2021\/04\/QQ\u622a\u56fe20210428112928-768x671.png 768w\" sizes=\"(max-width: 925px) 100vw, 925px\" \/><\/figure>\n\n\n\n<h2>\u6570\u636e\u7edf\u8ba1<\/h2>\n\n\n\n<p>\u672c\u8f66\u8054\u7f51\u9879\u76ee\u7684\u6570\u636e\u91cf\u4e3a\u4ebf\u4e07\u7ea7\uff0c\u7531\u4e8e\u6570\u636e\u91cf\u5e9e\u5927\uff0c\u4f20\u7edf\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5982mysql\u5df2\u7ecf\u65e0\u6cd5\u6ee1\u8db3\u4e1a\u52a1\u9700\u6c42\uff0c\u6240\u4ee5\u6211\u4eec\u5c31\u4f1a\u7528\u5230\u65f6\u5e8f\u6570\u636e\u5e93<\/p>\n\n\n\n<p>\u968f\u7740\u7269\u8054\u7f51\u7684\u53d1\u5c55\uff0c\u65f6\u5e8f\u6570\u636e\u5e93\u7684\u9700\u6c42\u8d8a\u6765\u8d8a\u591a\uff0c\u6bd4\u5982\u6c34\u6587\u76d1\u63a7\u3001\u5de5\u5382\u7684\u8bbe\u5907\u76d1\u63a7\u3001\u56fd\u5bb6\u5b89\u5168\u76f8\u5173\u7684\u6570\u636e\u76d1\u63a7\u3001\u901a\u8baf\u76d1\u63a7\u3001\u91d1\u878d\u884c\u4e1a\u6307\u6807\u6570\u636e\u3001\u4f20\u611f\u5668\u6570\u636e\u7b49\u3002<br>\u65f6\u5e8f\u6570\u636e\u6709\u51e0\u4e2a\u7279\u70b9\uff1a<\/p>\n\n\n\n<p>1. \u57fa\u672c\u4e0a\u90fd\u662f\u63d2\u5165\uff0c\u6ca1\u6709\u66f4\u65b0\u7684\u9700\u6c42\u3002<br>2. \u6570\u636e\u57fa\u672c\u4e0a\u90fd\u6709\u65f6\u95f4\u5c5e\u6027\uff0c\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\u4e0d\u65ad\u4ea7\u751f\u65b0\u7684\u6570\u636e\uff0c\u65e7\u7684\u6570\u636e\u4e0d\u9700\u8981\u4fdd\u5b58\u592a\u4e45\u3002<\/p>\n\n\n\n<p>\u4e1a\u52a1\u65b9\u5bf9\u65f6\u5e8f\u6570\u636e\u901a\u5e38\u6709\u51e0\u4e2a\u67e5\u8be2\u9700\u6c42\uff1a<\/p>\n\n\n\n<p>1. \u83b7\u53d6\u6700\u65b0\u72b6\u6001\uff0c\u67e5\u8be2\u6700\u8fd1\u7684\u6570\u636e\uff08\u4f8b\u5982\u4f20\u611f\u5668\u6700\u65b0\u7684\u72b6\u6001\uff09<br>2. \u5c55\u793a\u533a\u95f4\u7edf\u8ba1\uff0c\u6307\u5b9a\u65f6\u95f4\u8303\u56f4\uff0c\u67e5\u8be2\u7edf\u8ba1\u4fe1\u606f\uff0c\u4f8b\u5982\u5e73\u5747\u503c\uff0c\u6700\u5927\u503c\uff0c\u6700\u5c0f\u503c\uff0c\u8ba1\u6570\u7b49\u3002\u3002\u3002<br>3. \u83b7\u53d6\u5f02\u5e38\u6570\u636e\uff0c\u6839\u636e\u6307\u5b9a\u6761\u4ef6\uff0c\u7b5b\u9009\u5f02\u5e38\u6570\u636e<\/p>\n\n\n\n<p>\u67d0\u9879\u76ee\u4f7f\u7528\u5230\u4e86TimescaleDB\u65f6\u5e8f\u6570\u636e\u5e93<\/p>\n\n\n\n<p>TimescaleDB\u5176\u5b9e\u662f\u57fa\u4e8ePostgreSQL\u7684\u65f6\u5e8f\u6570\u636e\u5e93\u63d2\u4ef6\uff0c\u5b8c\u5168\u7ee7\u627f\u4e86PostgreSQL\u7684\u529f\u80fd\uff0c\u5bf9\u4e8e\u590d\u6742\u67e5\u8be2\uff0c\u5404\u79cd\u7c7b\u578b(GIS,json,k-v,\u56fe\u50cf\u7279\u5f81\u503c,range,\u6570\u7ec4,\u590d\u5408\u7c7b\u578b,\u81ea\u5b9a\u4e49\u7c7b\u578b,&#8230;..)\u7684\u652f\u6301\u975e\u5e38\u4e30\u5bcc\uff0c\u975e\u5e38\u9002\u5408\u5de5\u4e1a\u5316\u7684\u65f6\u5e8f\u6570\u636e\u5e93\u573a\u666f\u9700\u6c42\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u6570\u636e\u5e93\u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n\n\n\n<p>1. \u57fa\u4e8e\u65f6\u5e8f\u4f18\u5316<\/p>\n\n\n\n<p>2. \u81ea\u52a8\u5206\u7247\uff08\u6309\u65f6\u95f4\u3001\u7a7a\u95f4\u81ea\u52a8\u5206\u7247(chunk)\uff09<\/p>\n\n\n\n<p>3. \u5168SQL\u63a5\u53e3<\/p>\n\n\n\n<p>4. \u652f\u6301\u5782\u76f4\u4e8e\u6a2a\u5411\u6269\u5c55<\/p>\n\n\n\n<p>5. \u652f\u6301\u65f6\u95f4\u7ef4\u5ea6\u3001\u7a7a\u95f4\u7ef4\u5ea6\u81ea\u52a8\u5206\u533a\u3002\u7a7a\u95f4\u7ef4\u5ea6\u6307\u5c5e\u6027\u5b57\u6bb5\uff08\u4f8b\u5982\u4f20\u611f\u5668ID\uff0c\u7528\u6237ID\u7b49\uff09<\/p>\n\n\n\n<p>6. \u652f\u6301\u591a\u4e2aSERVER\uff0c\u591a\u4e2aCHUNK\u7684\u5e76\u884c\u67e5\u8be2\u3002\u5206\u533a\u5728TimescaleDB\u4e2d\u88ab\u79f0\u4e3achunk\u3002<\/p>\n\n\n\n<p>7. \u81ea\u52a8\u8c03\u6574CHUNK\u7684\u5927\u5c0f<\/p>\n\n\n\n<p>8. \u5185\u90e8\u5199\u4f18\u5316\uff08\u6279\u91cf\u63d0\u4ea4\u3001\u5185\u5b58\u7d22\u5f15\u3001\u4e8b\u52a1\u652f\u6301\u3001\u6570\u636e\u5012\u704c\uff09\u3002<\/p>\n\n\n\n<h2>\u53c2\u8003\uff1a<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/digoal\/blog\/blob\/master\/201704\/20170409_05.md\">https:\/\/github.com\/digoal\/blog\/blob\/master\/201704\/20170409_05.md<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/mjaschen\/phpgeo\" data-type=\"URL\" data-id=\"https:\/\/github.com\/mjaschen\/phpgeo\">https:\/\/github.com\/mjaschen\/phpgeo<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/phpgeo.marcusjaschen.de\/Calculations\/Geofence.html\">https:\/\/phpgeo.marcusjaschen.de\/Calculations\/Geofence.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u884c\u9a76\u8f68\u8ff9 \u7ecf\u7eac\u5ea6\u5750\u6807\u79cd\u7c7b\uff1a \u6211\u4eec\u5e38\u7528\u7684\u5730\u56feapi\u5750\u6807\u7cfb\u6709wgs84\u5750\u6807\u7cfb\uff0cgcj02\u5750\u6807\u7cfb\uff0cbd09\u5750\u6807\u7cfb\u3002 wgs\u5750\u6807\u7cfb\u662f\u56fd\u9645\u4e0a\u901a\u7528\u7684\u5750\u6807\u7cfb\uff0c\u4e5f\u79f0\u5730\u7403\u5750\u6807\u7cfb\uff0cgps\u548c\u5317\u6597\u7cfb\u7edf\u90fd\u4f7f\u7528\u7684\u662fwgs\u5750\u6807\u7cfb\u3002\u2026<\/p>\n","protected":false},"author":1,"featured_media":49,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"_links":{"self":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/28"}],"collection":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":19,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/76"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=\/wp\/v2\/media\/49"}],"wp:attachment":[{"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.osvlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}