• <i id='GhOLw'><tr id='GhOLw'><dt id='GhOLw'><q id='GhOLw'><span id='GhOLw'><b id='GhOLw'><form id='GhOLw'><ins id='GhOLw'></ins><ul id='GhOLw'></ul><sub id='GhOLw'></sub></form><legend id='GhOLw'></legend><bdo id='GhOLw'><pre id='GhOLw'><center id='GhOLw'></center></pre></bdo></b><th id='GhOLw'></th></span></q></dt></tr></i><div id='GhOLw'><tfoot id='GhOLw'></tfoot><dl id='GhOLw'><fieldset id='GhOLw'></fieldset></dl></div>
      • <bdo id='GhOLw'></bdo><ul id='GhOLw'></ul>
    1. <small id='GhOLw'></small><noframes id='GhOLw'>

    2. <tfoot id='GhOLw'></tfoot>
    3. <legend id='GhOLw'><style id='GhOLw'><dir id='GhOLw'><q id='GhOLw'></q></dir></style></legend>

        当多边形的点是经纬度时,如何计算MySQL数据库中

        时间:2023-08-21
        • <bdo id='FPBcc'></bdo><ul id='FPBcc'></ul>

              <tbody id='FPBcc'></tbody>

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

                  本文介绍了当多边形的点是经纬度时,如何计算MySQL数据库中多边形的面积?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  如何计算存储在 MySql 数据库中的多边形的面积?多边形的点是经纬度.所以,度数和分钟数似乎造成了问题.

                  How do I calculate the area of a polygon stored in a MySql database? The polygons' points are lat longs. So, degrees and minutes seem to be causing a problem.

                  我试过了:

                  SELECT AREA( my_polygon ) 
                  FROM  `my_table` 
                  WHERE name =  'Newport'
                  

                  因为点是经纬度,我得到了奇怪的结果.

                  Because, the points are lat longs, I get weird results.

                  (我无法切换到 Postgre).有没有办法在 MySQL 中做到这一点?我想以平方米或平方公里或平方英里为单位得到结果——这些都可以.

                  (I'm not able to switch to Postgre). Is there a way to do this in MySQL? I'd like to get the results in sq. meters or sq. km or sq. miles-- any of these would be fine.

                  推荐答案

                  您必须将这些纬度和经度转换为更合适的坐标系.

                  You've got to transform those lats and lons into a more appropriate coordinate system.

                  由于地球是一个球体,所以您指的是在球坐标系中计算面积.

                  Since the earth is a sphere, you're talking about calculating an area in spherical coordinates.

                  文档说 MySQL "AREA" 函数 将多边形作为其输入.我会说,如果你想要像平方英里这样的面积,你应该将你的纬度/经度坐标转换为具有正确单位(例如英里)的等效表面 (x, y) 坐标.然后将它们传递给 AREA 函数.

                  The docs say that the MySQL "AREA" function takes a polygon as its input. I would say that if you want area as something like square miles you should convert your lat/lon coordinates into equivalent surface (x, y) coordinates with the right units (e.g., miles). Then pass those into the AREA function.

                  此链接表明其他人遇到了此问题并已解决.

                  This link suggests that someone else has had this problem and solved it.

                  这篇关于当多边形的点是经纬度时,如何计算MySQL数据库中多边形的面积?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:从arduino获取数据并通过ethienet存储在数据库中 下一篇:如何在ansible中为不同的主机使用另一个任务中的

                  相关文章

                  最新文章

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

                  1. <tfoot id='5IYiA'></tfoot>

                    1. <small id='5IYiA'></small><noframes id='5IYiA'>

                        <bdo id='5IYiA'></bdo><ul id='5IYiA'></ul>