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

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

      <bdo id='A2tFX'></bdo><ul id='A2tFX'></ul>
    <i id='A2tFX'><tr id='A2tFX'><dt id='A2tFX'><q id='A2tFX'><span id='A2tFX'><b id='A2tFX'><form id='A2tFX'><ins id='A2tFX'></ins><ul id='A2tFX'></ul><sub id='A2tFX'></sub></form><legend id='A2tFX'></legend><bdo id='A2tFX'><pre id='A2tFX'><center id='A2tFX'></center></pre></bdo></b><th id='A2tFX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='A2tFX'><tfoot id='A2tFX'></tfoot><dl id='A2tFX'><fieldset id='A2tFX'></fieldset></dl></div>
    <tfoot id='A2tFX'></tfoot>
    <legend id='A2tFX'><style id='A2tFX'><dir id='A2tFX'><q id='A2tFX'></q></dir></style></legend>
    1. 查找兩個經(jīng)緯度點之間距離的最快方法

      Fastest Way to Find Distance Between Two Lat/Long Points(查找兩個經(jīng)緯度點之間距離的最快方法)
      <i id='jFMQX'><tr id='jFMQX'><dt id='jFMQX'><q id='jFMQX'><span id='jFMQX'><b id='jFMQX'><form id='jFMQX'><ins id='jFMQX'></ins><ul id='jFMQX'></ul><sub id='jFMQX'></sub></form><legend id='jFMQX'></legend><bdo id='jFMQX'><pre id='jFMQX'><center id='jFMQX'></center></pre></bdo></b><th id='jFMQX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='jFMQX'><tfoot id='jFMQX'></tfoot><dl id='jFMQX'><fieldset id='jFMQX'></fieldset></dl></div>
        <tbody id='jFMQX'></tbody>
      <legend id='jFMQX'><style id='jFMQX'><dir id='jFMQX'><q id='jFMQX'></q></dir></style></legend>
          <bdo id='jFMQX'></bdo><ul id='jFMQX'></ul>

          • <small id='jFMQX'></small><noframes id='jFMQX'>

              <tfoot id='jFMQX'></tfoot>
              1. 本文介紹了查找兩個經(jīng)緯度點之間距離的最快方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我目前在 mysql 數(shù)據(jù)庫中有不到一百萬個位置,所有位置都包含經(jīng)度和緯度信息.

                I currently have just under a million locations in a mysql database all with longitude and latitude information.

                我試圖通過查詢找到一個點和許多其他點之間的距離.它沒有我想要的那么快,尤其是每秒 100 次以上的點擊.

                I am trying to find the distance between one point and many other points via a query. It's not as fast as I want it to be especially with 100+ hits a second.

                是否有比 mysql 更快的查詢或可能更快的系統(tǒng)?我正在使用這個查詢:

                Is there a faster query or possibly a faster system other than mysql for this? I'm using this query:

                SELECT 
                  name, 
                   ( 3959 * acos( cos( radians(42.290763) ) * cos( radians( locations.lat ) ) 
                   * cos( radians(locations.lng) - radians(-71.35368)) + sin(radians(42.290763)) 
                   * sin( radians(locations.lat)))) AS distance 
                FROM locations 
                WHERE active = 1 
                HAVING distance < 10 
                ORDER BY distance;
                

                注意:提供的距離以英里為單位.如果您需要公里,請使用6371 而不是3959.

                Note: The provided distance is in Miles. If you need Kilometers, use 6371 instead of 3959.

                推薦答案

                • 使用MyISAM 表中Geometry 數(shù)據(jù)類型的Point 值創(chuàng)建您的點.從 Mysql 5.7.5 開始,InnoDB 表現(xiàn)在也支持 SPATIAL 索引.

                  • Create your points using Point values of Geometry data types in MyISAM table. As of Mysql 5.7.5, InnoDB tables now also support SPATIAL indices.

                    在這些點上創(chuàng)建SPATIAL索引

                    使用 MBRContains() 查找值:

                      SELECT  *
                      FROM    table
                      WHERE   MBRContains(LineFromText(CONCAT(
                              '('
                              , @lon + 10 / ( 111.1 / cos(RADIANS(@lat)))
                              , ' '
                              , @lat + 10 / 111.1
                              , ','
                              , @lon - 10 / ( 111.1 / cos(RADIANS(@lat)))
                              , ' '
                              , @lat - 10 / 111.1 
                              , ')' )
                              ,mypoint)
                    

                  • ,或者,在 MySQL 5.1 及以上:

                    , or, in MySQL 5.1 and above:

                        SELECT  *
                        FROM    table
                        WHERE   MBRContains
                                        (
                                        LineString
                                                (
                                                Point (
                                                        @lon + 10 / ( 111.1 / COS(RADIANS(@lat))),
                                                        @lat + 10 / 111.1
                                                      ),
                                                Point (
                                                        @lon - 10 / ( 111.1 / COS(RADIANS(@lat))),
                                                        @lat - 10 / 111.1
                                                      ) 
                                                ),
                                        mypoint
                                        )
                    

                    這將選擇(@lat +/- 10 km, @lon +/- 10km)框內(nèi)的所有點.

                    This will select all points approximately within the box (@lat +/- 10 km, @lon +/- 10km).

                    這實際上不是一個盒子,而是一個球面矩形:球體的經(jīng)緯度邊界段.這可能與弗朗茨約瑟夫地上的普通矩形不同,但在大多數(shù)有人居住的地方非常接近.

                    This actually is not a box, but a spherical rectangle: latitude and longitude bound segment of the sphere. This may differ from a plain rectangle on the Franz Joseph Land, but quite close to it on most inhabited places.

                    • 應(yīng)用額外的過濾來選擇圓圈內(nèi)的所有內(nèi)容(不是正方形)

                    • Apply additional filtering to select everything inside the circle (not the square)

                    可能應(yīng)用額外的精細過濾來解釋大圓距離(對于大距離)

                    Possibly apply additional fine filtering to account for the big circle distance (for large distances)

                    這篇關(guān)于查找兩個經(jīng)緯度點之間距離的最快方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

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

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

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

                          <tbody id='t9BoD'></tbody>

                          主站蜘蛛池模板: 久久综合色综合 | 毛片在线视频 | 国产综合久久 | 亚洲欧美成人影院 | 黄色毛片在线观看 | 一区日韩 | 日本久久福利 | 成人综合视频在线观看 | 国产精品久久久久久久一区探花 | av中文字幕在线 | 国产精品精品久久久 | 日韩在线观看精品 | a在线免费观看视频 | 午夜影视网 | av中文字幕网站 | 爱综合| 亚洲成人av | 瑟瑟免费视频 | 亚洲成av人片在线观看 | 久久久久网站 | www性色| 黄色大片免费网站 | 亚洲导航深夜福利涩涩屋 | 最新国产精品视频 | 亚洲天堂久久新 | 久久久精品 | 9久久 | 青青草华人在线视频 | 国产精品乱码一区二区三区 | 欧美网址在线观看 | 日韩电影一区 | 日韩中文在线视频 | 久久久久国产精品一区三寸 | 三级黄色片在线播放 | 精品人伦一区二区三区蜜桃网站 | 亚洲高清在线 | 国产精品福利在线 | 伊人久久国产 | 国产这里只有精品 | 欧美jizzhd精品欧美巨大免费 | 亚洲国产一区二区三区四区 |