1. <tfoot id='cHUIN'></tfoot>

  2. <i id='cHUIN'><tr id='cHUIN'><dt id='cHUIN'><q id='cHUIN'><span id='cHUIN'><b id='cHUIN'><form id='cHUIN'><ins id='cHUIN'></ins><ul id='cHUIN'></ul><sub id='cHUIN'></sub></form><legend id='cHUIN'></legend><bdo id='cHUIN'><pre id='cHUIN'><center id='cHUIN'></center></pre></bdo></b><th id='cHUIN'></th></span></q></dt></tr></i><div id='cHUIN'><tfoot id='cHUIN'></tfoot><dl id='cHUIN'><fieldset id='cHUIN'></fieldset></dl></div>
    <legend id='cHUIN'><style id='cHUIN'><dir id='cHUIN'><q id='cHUIN'></q></dir></style></legend>

      <small id='cHUIN'></small><noframes id='cHUIN'>

        <bdo id='cHUIN'></bdo><ul id='cHUIN'></ul>
    1. 从 kml 文件计算地面覆盖角的纬度/经度

      Calculate lat/lng of corners of ground overlay from kml-file(从 kml 文件计算地面覆盖角的纬度/经度)
        <tbody id='CB3HR'></tbody>
      <i id='CB3HR'><tr id='CB3HR'><dt id='CB3HR'><q id='CB3HR'><span id='CB3HR'><b id='CB3HR'><form id='CB3HR'><ins id='CB3HR'></ins><ul id='CB3HR'></ul><sub id='CB3HR'></sub></form><legend id='CB3HR'></legend><bdo id='CB3HR'><pre id='CB3HR'><center id='CB3HR'></center></pre></bdo></b><th id='CB3HR'></th></span></q></dt></tr></i><div id='CB3HR'><tfoot id='CB3HR'></tfoot><dl id='CB3HR'><fieldset id='CB3HR'></fieldset></dl></div>
      • <legend id='CB3HR'><style id='CB3HR'><dir id='CB3HR'><q id='CB3HR'></q></dir></style></legend>

          <tfoot id='CB3HR'></tfoot>
              <bdo id='CB3HR'></bdo><ul id='CB3HR'></ul>

                <small id='CB3HR'></small><noframes id='CB3HR'>

                本文介绍了从 kml 文件计算地面覆盖角的纬度/经度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要在 php 或 javascript 中找到 kml 文件中给出的地面覆盖层的纬度/经度角.

                I need to find the corners in lat/lng of a ground overlay given in a kml-file either in php or javascript.

                即对于一个具体的例子,我需要从:

                I.e. for a specific example I need to get from:

                  <LatLonBox>
                    <north>60.406505416667</north>
                    <south>60.400570555556</south>
                    <east>5.3351572222222</east>
                    <west>5.3190577777778</west>
                    <rotation>3.7088732260919</rotation>
                  </LatLonBox>
                

                转角坐标

                SW: 60.400316388889;5.3194425
                SE: 60.400824722222;5.3355405555556
                NE: 60.406759444444;5.3347738888889
                NW: 60.406251388889;5.3186730555556
                

                我可以通过

                $w=($nw_lng+$sw_lng)/2;
                $e=($ne_lng+$se_lng)/2;
                $n=($ne_lat+$nw_lat)/2;
                $s=($se_lat+$sw_lat)/2;
                $rot= rad2deg (atan ( ( $nw_lng - $sw_lng ) / ($sw_lat - $nw_lat ) / 2  ) );
                

                应该很容易回来,但我已经为此花费了几个小时而没有到达那里.有什么建议吗?

                Should be easy to get back, but I've used hours for this without getting there. Any tips?

                推荐答案

                你需要使用球面三角函数,球面几何的一部分,以确保完全准确.但是,由于您只处理球体的一小部分,如果您记住一件事,欧几里德几何就可以了.

                You need to use spherical trigonometry, part of spherical geometry for full accuracy. However, since you are dealing with only a small piece of the sphere, euclidian geometry will do if you remember one thing.

                随着纬度的增加,经线越来越靠近.例如,在北极附近,纬线几乎是相接的.因此,调节您的纬度差异,通过乘以 cos(纬度)因子来减少它们.这将为您的应用提供足够好的准确性.

                As latitude increases, the lines of longitude get closer together. For example, near the North Pole, the latitude lines are almost touching. So condition your latitude differences, diminishing them by mulitlying by a factor of cos(latitude). That will give you good enough accuracy for your app.

                 $n = 60.406505416667;
                 $s = 60.400570555556;
                 $e = 5.3351572222222;
                 $w = 5.3190577777778;
                 $rotn = 3.7088732260919;
                
                 $a = ($e + $w) / 2.0;
                 $b = ($n + $s) / 2.0;
                 $squish = cos(deg2rad($b));
                 $x = $squish * ($e - $w) / 2.0;
                 $y = ($n - $s) / 2.0;
                
                 $ne = array(
                   $a + ($x * cos(deg2rad($rotn)) - $y * sin(deg2rad($rotn))) /$squish,
                   $b + $x * sin(deg2rad($rotn)) + $y *cos(deg2rad($rotn))
                   );
                 $nw = array(
                   $a - ($x * cos(deg2rad($rotn)) + $y * sin(deg2rad($rotn))) /$squish,
                   $b - $x * sin(deg2rad($rotn)) + $y *cos(deg2rad($rotn))
                   );
                 $sw = array(
                   $a - ($x * cos(deg2rad($rotn)) - $y * sin(deg2rad($rotn))) /$squish,
                   $b - $x * sin(deg2rad($rotn)) - $y *cos(deg2rad($rotn))
                   );
                 $se = array(
                   $a + ($x * cos(deg2rad($rotn)) + $y * sin(deg2rad($rotn))) /$squish,
                   $b + $x * sin(deg2rad($rotn)) - $y *cos(deg2rad($rotn))
                   );
                 print_r(array(
                 'sw'=>$sw,
                 'se'=>$se,
                 'ne'=>$ne,
                 'nw'=>$nw,
                 ));
                

                我的 $squish 变量是我提到的 cos(lat).水平长度的相对部分有去挤压功能.正弦表如下所示:

                My $squish variable is the cos(lat) I mentioned. There is de-squishing for the relative part of horizontal lengths. The sine table looks like this:

                NE: (a + x cos A - y sin A, b + x sin A + y cos A)
                NW: (a - x cos A - y sin A, b - x sin A + y cos A)
                SW: (a - x cos A + y sin A, b - x sin A - y cos A)
                SE: (a + x cos A + y sin A, b + x sin A - y cos A)
                

                也许 tttppp 可以解释与 tttppp 表的差异.

                Perhaps tttppp could account for the differences from tttppp's table.

                这篇关于从 kml 文件计算地面覆盖角的纬度/经度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                <legend id='RRSDh'><style id='RRSDh'><dir id='RRSDh'><q id='RRSDh'></q></dir></style></legend>
                • <i id='RRSDh'><tr id='RRSDh'><dt id='RRSDh'><q id='RRSDh'><span id='RRSDh'><b id='RRSDh'><form id='RRSDh'><ins id='RRSDh'></ins><ul id='RRSDh'></ul><sub id='RRSDh'></sub></form><legend id='RRSDh'></legend><bdo id='RRSDh'><pre id='RRSDh'><center id='RRSDh'></center></pre></bdo></b><th id='RRSDh'></th></span></q></dt></tr></i><div id='RRSDh'><tfoot id='RRSDh'></tfoot><dl id='RRSDh'><fieldset id='RRSDh'></fieldset></dl></div>

                    • <bdo id='RRSDh'></bdo><ul id='RRSDh'></ul>
                        <tfoot id='RRSDh'></tfoot>
                            <tbody id='RRSDh'></tbody>

                          <small id='RRSDh'></small><noframes id='RRSDh'>