久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='YJIgY'><tr id='YJIgY'><dt id='YJIgY'><q id='YJIgY'><span id='YJIgY'><b id='YJIgY'><form id='YJIgY'><ins id='YJIgY'></ins><ul id='YJIgY'></ul><sub id='YJIgY'></sub></form><legend id='YJIgY'></legend><bdo id='YJIgY'><pre id='YJIgY'><center id='YJIgY'></center></pre></bdo></b><th id='YJIgY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YJIgY'><tfoot id='YJIgY'></tfoot><dl id='YJIgY'><fieldset id='YJIgY'></fieldset></dl></div>

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

    <legend id='YJIgY'><style id='YJIgY'><dir id='YJIgY'><q id='YJIgY'></q></dir></style></legend>

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

        根據半徑從地圖數據庫中選擇點

        Select points from map database according to radius(根據半徑從地圖數據庫中選擇點)
          <tbody id='VbKRG'></tbody>

          1. <legend id='VbKRG'><style id='VbKRG'><dir id='VbKRG'><q id='VbKRG'></q></dir></style></legend>

              <tfoot id='VbKRG'></tfoot>
              <i id='VbKRG'><tr id='VbKRG'><dt id='VbKRG'><q id='VbKRG'><span id='VbKRG'><b id='VbKRG'><form id='VbKRG'><ins id='VbKRG'></ins><ul id='VbKRG'></ul><sub id='VbKRG'></sub></form><legend id='VbKRG'></legend><bdo id='VbKRG'><pre id='VbKRG'><center id='VbKRG'></center></pre></bdo></b><th id='VbKRG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VbKRG'><tfoot id='VbKRG'></tfoot><dl id='VbKRG'><fieldset id='VbKRG'></fieldset></dl></div>

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

              • <bdo id='VbKRG'></bdo><ul id='VbKRG'></ul>

                • 本文介紹了根據半徑從地圖數據庫中選擇點的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個包含點的緯度/經度的數據庫.如果我想選擇以特定點為中心的特定范圍內的所有點,它可以正常工作,但如果該中心有任何點,則不會被選中!

                  I have a database which has latitude/longitude of points. If I want to select all points within a specific range centered in a specific point it works fine BUT if there is any point located at this center, it will not get selected!

                  我使用這個查詢:

                  SELECT *, ( 6371 * acos( cos( radians(-27.5796498) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(-48.543221) ) + sin( radians(-27.5796498) ) * sin( radians( latitude ) ) ) ) AS distance FROM map HAVING distancia <= 2
                  

                  在上面的情況下,半徑為2",地圖中心位于 [-27.5796498,-27.5796498].這個查詢真的很好,但是如果某個點位于這個非常精確的中心,它就不會被選中.為什么?

                  In the case above the radius is "2" and the center of the map is at [-27.5796498,-27.5796498]. This query works really fine BUT if some point is located at this very exact center, it will not get selected. Why?

                  我發現上面的公式為所有點返回了一個很好的值,但是到位于中心的點 MYSQL 將值 NULL 返回到列距離"!專業人士如何處理這種使用SQL在包括中心點在內的范圍內選擇點的問題?

                  I discovered that the formula above returns a good value for all the points BUT to the point located at the center MYSQL returns the value NULL to the column "distance"! How do the professionals deal with this kind or problem of using SQL to select points within a range including the center point?

                  我可以創建另一個查詢來選擇位于半徑正中心的所有點,但這效率不高,也許某些數學向導可以提出更好的公式.

                  I could create another query to select all the points located at the very center of the radius, but that's not efficient, maybe some math wizard could come up with a better formula.

                  推薦答案

                  有時 ACOS() 的參數可以略大于 1 -- 稍微超出該函數的域 -- 當距離很小.由于 Vincenty,有一個更好的距離公式可用.它使用 ATAN2(y,x) 函數而不是 ACOS() 函數,因此在數值上更穩定.

                  Sometimes the parameter to ACOS() can be just slightly greater than 1 -- slightly outside the domain of that function -- when distances are small. There's a better distance formula available, due to Vincenty. It uses the ATAN2(y,x) function rather than the ACOS() function and so is more numerically stable.

                  就是這樣.

                  DEGREES(
                      ATAN2(
                        SQRT(
                          POW(COS(RADIANS(lat2))*SIN(RADIANS(lon2-lon1)),2) +
                          POW(COS(RADIANS(lat1))*SIN(RADIANS(lat2)) -
                               (SIN(RADIANS(lat1))*COS(RADIANS(lat2)) *
                                COS(RADIANS(lon2-lon1))) ,2)),
                        SIN(RADIANS(lat1))*SIN(RADIANS(lat2)) +
                        COS(RADIANS(lat1))*COS(RADIANS(lat2))*COS(RADIANS(lon2-lon1))))
                  

                  此函數以度為單位返回其結果.一個度有111.045公里.60 海里.69 法定英里.因此,將結果乘以這些數字之一以獲得距離.有一個更完整的文章,包括 MySQL 的存儲函數定義,這里.

                  This function returns its result in degrees. There are 111.045 km in a degree. 60 nautical miles. 69 statute miles. So multiply the result by one of those numbers to get distance. There's a more complete writeup, including a stored-function definition for MySQL, here.

                  另一種解決方案是使用 ISNULL(ACOS(formula), 0.0)

                  Another solution is to use ISNULL(ACOS(formula), 0.0)

                  這篇關于根據半徑從地圖數據庫中選擇點的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)

                      <tfoot id='O1By0'></tfoot>
                        <tbody id='O1By0'></tbody>
                      1. <small id='O1By0'></small><noframes id='O1By0'>

                        <legend id='O1By0'><style id='O1By0'><dir id='O1By0'><q id='O1By0'></q></dir></style></legend>
                          • <bdo id='O1By0'></bdo><ul id='O1By0'></ul>
                            <i id='O1By0'><tr id='O1By0'><dt id='O1By0'><q id='O1By0'><span id='O1By0'><b id='O1By0'><form id='O1By0'><ins id='O1By0'></ins><ul id='O1By0'></ul><sub id='O1By0'></sub></form><legend id='O1By0'></legend><bdo id='O1By0'><pre id='O1By0'><center id='O1By0'></center></pre></bdo></b><th id='O1By0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='O1By0'><tfoot id='O1By0'></tfoot><dl id='O1By0'><fieldset id='O1By0'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 国产草草视频 | 午夜影院在线免费观看视频 | 中文字幕一区二区视频 | 欧美在线一区二区三区 | 久久爱综合 | 羞视频在线观看 | 欧美日本韩国一区二区 | 亚洲视频一区在线观看 | 亚洲精品免费视频 | 久久午夜视频 | 涩涩片影院 | 99久久精品一区二区成人 | 国产视频一区二区三区四区五区 | 国产高清久久久 | 麻豆精品一区二区三区在线观看 | 欧美日本韩国一区二区 | 久久精品屋 | 日本一卡精品视频免费 | 亚洲一区二区在线 | 中文字幕在线第一页 | 免费午夜视频在线观看 | 国产免费一区二区 | 国产精品色一区二区三区 | 99精品久久久 | 日韩成人免费视频 | 一级片在线播放 | 欧美黄视频 | 在线观看中文视频 | 91麻豆产精品久久久久久夏晴子 | 久久久久久影院 | 久久精品日产第一区二区三区 | 久在线| 成人在线视频免费观看 | 天天综合网天天综合 | 国产精品视频专区 | 国产精品毛片无码 | 日韩在线视频一区二区三区 | 成人影院在线观看 | 成人精品免费 | 成年人在线播放 | 国产精品波多野结衣 |