﻿{"id":896,"date":"2014-10-09T13:46:43","date_gmt":"2014-10-09T05:46:43","guid":{"rendered":"http:\/\/www.tansoo.cn\/?p=896"},"modified":"2014-10-09T13:50:58","modified_gmt":"2014-10-09T05:50:58","slug":"%e5%b0%86gps%e7%9a%84wgs84%e5%9d%90%e6%a0%87%ef%bc%88%e5%a4%a7%e5%9c%b0%e5%9d%90%e6%a0%87%e7%b3%bb%ef%bc%89%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%b9%b3%e9%9d%a2%e5%9d%90%e6%a0%87%ef%bc%88%e7%ac%9b%e5%8d%a1","status":"publish","type":"post","link":"http:\/\/www.tansoo.cn\/?p=896","title":{"rendered":"\u5c06GPS\u7684WGS84\u5750\u6807\uff08\u5927\u5730\u5750\u6807\u7cfb\uff09\u8f6c\u6362\u4e3a\u5e73\u9762\u5750\u6807\uff08\u7b1b\u5361\u5c14\u5750\u6807\u7cfb\uff09\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u4eceGPS\u6a21\u5757\u4e2d\u83b7\u5f97\u7684\u5750\u6807\u662f\u5c5e\u4e8e\u7403\u9762\u5750\u6807\uff0c\u5e76\u4e0d\u662f\u6211\u4eec\u5e73\u5e38\u63a5\u89e6\u5230\u7684\u5e73\u9762\u5750\u6807\uff0c\u6240\u4ee5\u5728\u8ba1\u7b97\u4e24\u70b9\u95f4\u8ddd\u79bb\u7684\u65f6\u5019\u4e0d\u80fd\u7b80\u5355\u7684\u5229\u7528\u52fe\u80a1\u5b9a\u7406\u6765\u8ba1\u7b97\uff0c\u800c\u662f\u8981\u5c06GPS\u4e2d\u7684\u5750\u6807\u8f6c\u6362\u4e3a\u5e38\u7528\u7684\u5e73\u9762\u5750\u6807\u3002\u7531\u4e8e\u5730\u7403\u662f\u4e00\u4e2a\u4e0d\u89c4\u5219\u7684\u692d\u5706\uff0c\u7cbe\u786e\u8ba1\u7b97\u65b9\u6cd5\u5f88\u590d\u6742\uff0c\u8ba1\u7b97\u91cf\u4e5f\u975e\u5e38\u5927\u3002\u7531\u4e8e\u6211\u4eec\u5e73\u5e38\u4f7f\u7528\u4e2d\u4e0d\u9700\u8981\u975e\u5e38\u7cbe\u786e\u7684\u8f6c\u6362\uff0c\u8fd9\u91cc\u5c31\u5229\u7528\u4e00\u4e2a\u8fd1\u4f3c\u7684\u8ba1\u7b97\u65b9\u6cd5\u6765\u8fdb\u884c\u8f6c\u6362\uff0c\u7ecf\u8fc7\u6d4b\u8bd5\u5bf9\u6bd4\uff0c\u6bd4\u767e\u5ea6\u7684\u8ba1\u7b97\u65b9\u5f0f\u66f4\u7cbe\u786e\u3002\uff08\u5173\u4e8e\u5750\u6807\u8f6c\u6362\u7684\u66f4\u591a\u77e5\u8bc6\u53ef\u4ee5\u767e\u5ea6\u4e0a\u67e5\u627e\uff0c\u672c\u8ba1\u7b97\u65b9\u6cd5\u4e5f\u662f\u5728\u522b\u4eba\u7684\u57fa\u7840\u4e0a\u4fee\u6539\u800c\u6765\u3002\uff09<!--more--><\/p>\n<pre class=\"lang:delphi decode:true \" title=\"\u5750\u6807\u7cfb\u8f6c\u6362\u51fd\u6570\" >type\r\n\/\/ \u7b1b\u5361\u5c14\u5750\u6807\u7cfb\r\n  tagCRDCARTESIAN = record\r\n    X, Y, z: double;\r\n  end;\r\n\r\n  CRDCARTESIAN = tagCRDCARTESIAN;\r\n\r\n  \/\/ \u5927\u5730\u5750\u6807\u7cfb\r\n  tagCRDGEODETIC = record\r\n    longitude: double; \/\/ \u7ecf\u5ea6\r\n    latitude: double; \/\/ \u7eac\u5ea6\r\n    height: double; \/\/ \u5927\u5730\u9ad8,\u53ef\u8bbe\u4e3a0\r\n  end;\r\n\r\n  CRDGEODETIC = tagCRDGEODETIC;\r\n\r\nfunction GeodeticToCartesian(pcg: CRDGEODETIC): CRDCARTESIAN;\r\nvar\r\n  b: double; \/\/ \u7eac\u5ea6\u5ea6\u6570\r\n  L: double; \/\/ \u7ecf\u5ea6\u5ea6\u6570\r\n  L0: double; \/\/ \u4e2d\u592e\u7ecf\u7ebf\u5ea6\u6570\r\n  L1: double; \/\/ L-L0\r\n  t: double; \/\/ tanB\r\n  m: double; \/\/ ltanB\r\n  N: double; \/\/ \u536f\u9149\u5708\u66f2\u7387\u534a\u5f84\r\n  q2: double;\r\n  X: double; \/\/ \u9ad8\u65af\u5e73\u9762\u7eb5\u5750\u6807\r\n  Y: double; \/\/ \u9ad8\u65af\u5e73\u9762\u6a2a\u5750\u6807\r\n  s: double; \/\/ \u8d64\u9053\u81f3\u7eac\u5ea6B\u7684\u7ecf\u7ebf\u5f27\u957f\r\n  f: double; \/\/ \u53c2\u8003\u692d\u7403\u4f53\u6241\u7387\r\n  e2: double; \/\/ \u692d\u7403\u7b2c\u4e00\u504f\u5fc3\u7387\r\n  a: double; \/\/ \u53c2\u8003\u692d\u7403\u4f53\u957f\u534a\u8f74\r\n  \/\/ b:double;        \/\/\u53c2\u8003\u692d\u7403\u4f53\u77ed\u534a\u8f74\r\n  a1: double;\r\n  a2: double;\r\n  a3: double;\r\n  a4: double;\r\n  b1: double;\r\n  b2: double;\r\n  b3: double;\r\n  b4: double;\r\n  c0: double;\r\n  c1: double;\r\n  c2: double;\r\n  c3: double;\r\n  Datum, prjno, zonewide: Integer;\r\n  IPI: double;\r\nbegin\r\n  Datum := 84; \/\/ \u6295\u5f71\u57fa\u51c6\u9762\u7c7b\u578b\uff1a\u5317\u4eac54\u57fa\u51c6\u9762\u4e3a54\uff0c\u897f\u5b8980\u57fa\u51c6\u9762\u4e3a80\uff0cWGS84\u57fa\u51c6\u9762\u4e3a84\r\n  prjno := 0; \/\/ \u6295\u5f71\u5e26\u53f7\r\n  zonewide := 3;\r\n  IPI := 0.0174532925199433333333; \/\/ 3.1415926535898\/180.0\r\n  b := pcg.latitude; \/\/ \u7eac\u5ea6\r\n  L := pcg.longitude; \/\/ \u7ecf\u5ea6\r\n  if (zonewide = 6) then\r\n  begin\r\n    prjno := trunc(L \/ zonewide) + 1;\r\n    L0 := prjno * zonewide - 3;\r\n  end\r\n  else\r\n  begin\r\n    prjno := trunc((L - 1.5) \/ 3) + 1;\r\n    L0 := prjno * 3;\r\n  end;\r\n\r\n  if (Datum = 54) then\r\n  begin\r\n    a := 6378245;\r\n    f := 1 \/ 298.3;\r\n  end\r\n  else if (Datum = 84) then\r\n  begin\r\n    a := 6378137;\r\n    f := 1 \/ 298.257223563;\r\n  end;\r\n  L0 := L0 * IPI;\r\n  L := L * IPI;\r\n  b := b * IPI;\r\n\r\n  e2 := 2 * f - f * f; \/\/ (a*a-b*b)\/(a*a);\r\n  L1 := L - L0;\r\n  t := Tan(b);\r\n  m := L1 * cos(b);\r\n  N := a \/ sqrt(1 - e2 * sin(b) * sin(b));\r\n  q2 := e2 \/ (1 - e2) * cos(b) * cos(b);\r\n  a1 := 1 + 3 \/ 4 * e2 + 45 \/ 64 * e2 * e2 + 175 \/ 256 * e2 * e2 * e2 + 11025 \/\r\n    16384 * e2 * e2 * e2 * e2 + 43659 \/ 65536 * e2 * e2 * e2 * e2 * e2;\r\n  a2 := 3 \/ 4 * e2 + 15 \/ 16 * e2 * e2 + 525 \/ 512 * e2 * e2 * e2 + 2205 \/\r\n    2048 * e2 * e2 * e2 * e2 + 72765 \/ 65536 * e2 * e2 * e2 * e2 * e2;\r\n  a3 := 15 \/ 64 * e2 * e2 + 105 \/ 256 * e2 * e2 * e2 + 2205 \/ 4096 * e2 * e2 *\r\n    e2 * e2 + 10359 \/ 16384 * e2 * e2 * e2 * e2 * e2;\r\n  a4 := 35 \/ 512 * e2 * e2 * e2 + 315 \/ 2048 * e2 * e2 * e2 * e2 + 31185 \/\r\n    13072 * e2 * e2 * e2 * e2 * e2;\r\n  b1 := a1 * a * (1 - e2);\r\n  b2 := -1 \/ 2 * a2 * a * (1 - e2);\r\n  b3 := 1 \/ 4 * a3 * a * (1 - e2);\r\n  b4 := -1 \/ 6 * a4 * a * (1 - e2);\r\n  c0 := b1;\r\n  c1 := 2 * b2 + 4 * b3 + 6 * b4;\r\n  c2 := -(8 * b3 + 32 * b4);\r\n  c3 := 32 * b4;\r\n  s := c0 * b + cos(b) * (c1 * sin(b) + c2 * sin(b) * sin(b) * sin(b) + c3 * sin\r\n      (b) * sin(b) * sin(b) * sin(b) * sin(b));\r\n  X := s + 1 \/ 2 * N * t * m * m + 1 \/ 24 * (5 - t * t + 9 * q2 + 4 * q2 * q2)\r\n    * N * t * m * m * m * m + 1 \/ 720 * (61 - 58 * t * t + t * t * t * t)\r\n    * N * t * m * m * m * m * m * m;\r\n  Y := N * m + 1 \/ 6 * (1 - t * t + q2) * N * m * m * m + 1 \/ 120 *\r\n    (5 - 18 * t * t + t * t * t * t - 14 * q2 - 58 * q2 * t * t)\r\n    * N * m * m * m * m * m;\r\n  Y := Y + 1000000 * prjno + 500000;\r\n  Result.X := X;\r\n  Result.Y := Y - 38000000;\r\n  Result.z := 0;\r\nend;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4eceGPS\u6a21\u5757\u4e2d\u83b7\u5f97\u7684\u5750\u6807\u662f\u5c5e\u4e8e\u7403\u9762\u5750\u6807\uff0c\u5e76\u4e0d\u662f\u6211\u4eec\u5e73\u5e38\u63a5\u89e6\u5230\u7684\u5e73\u9762\u5750\u6807\uff0c\u6240\u4ee5\u5728\u8ba1\u7b97\u4e24\u70b9\u95f4\u8ddd\u79bb\u7684\u65f6\u5019\u4e0d\u80fd\u7b80\u5355\u7684\u5229 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[12,46,47,48],"class_list":["post-896","post","type-post","status-publish","format-standard","hentry","category-program","tag-wgs84","tag-46","tag-47","tag-48"],"_links":{"self":[{"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts\/896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=896"}],"version-history":[{"count":0,"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=\/wp\/v2\/posts\/896\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=896"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tansoo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}