pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="v9xt77x" 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="xdbbnnz" 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="tn3z3df" id='O1By0'><tfoot id='O1By0'></tfoot><dl id='O1By0'><fieldset id='O1By0'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 开平机_纵剪机厂家_开平机生产厂家|诚信互赢-泰安瑞烨精工机械制造有限公司 | 防爆大气采样器-防爆粉尘采样器-金属粉尘及其化合物采样器-首页|盐城银河科技有限公司 | 专业的新乡振动筛厂家-振动筛品质保障-环保振动筛价格—新乡市德科筛分机械有限公司 | 扬州汇丰仪表有限公司| 橡胶粉碎机_橡胶磨粉机_轮胎粉碎机_轮胎磨粉机-河南鼎聚重工机械制造有限公司 | 中央空调维修、中央空调保养、螺杆压缩机维修-苏州东菱空调 | 胶原检测试剂盒,弹性蛋白检测试剂盒,类克ELISA试剂盒,阿达木单抗ELISA试剂盒-北京群晓科苑生物技术有限公司 | 温泉机设备|温泉小镇规划设计|碳酸泉设备 - 大连连邦温泉科技 | 定制/定做冲锋衣厂家/公司-订做/订制冲锋衣价格/费用-北京圣达信 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | 湖南教师资格网-湖南教师资格证考试网 | 行吊_电动单梁起重机_双梁起重机_合肥起重机_厂家_合肥市神雕起重机械有限公司 | 橡胶接头|可曲挠橡胶接头|橡胶软接头安装使用教程-上海松夏官方网站 | 天津仓储物流-天津电商云仓-天津云仓一件代发-博程云仓官网 | 瓶盖扭矩仪(扭力值检测)-百科| 礼至家居-全屋定制家具_一站式全屋整装_免费量房设计报价 | 润东方环保空调,冷风机,厂房车间降温设备-20年深圳环保空调生产厂家 | 英思科GTD-3000EX(美国英思科气体检测仪MX4MX6)百科-北京嘉华众信科技有限公司 | 手持式3d激光扫描仪-便携式三维立体扫描仪-北京福禄克斯 | 德国UST优斯特氢气检漏仪-德国舒赐乙烷检测仪-北京泽钏 | 华夏医界网_民营医疗产业信息平台_民营医院营销管理培训 | 超声波清洗机_细胞破碎仪_实验室超声仪器_恒温水浴-广东洁盟深那仪器 | 碎石机设备-欧版反击破-欧版颚式破碎机(站)厂家_山东奥凯诺机械 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 水厂自动化|污水处理中控系统|水利信息化|智慧水务|智慧农业-山东德艾自动化科技有限公司 | 滚塑PE壳体-PE塑料浮球-警示PE浮筒-宁波君益塑业有限公司 | 威实软件_软件定制开发_OA_OA办公系统_OA系统_办公自动化软件 | 百度网站优化,关键词排名,SEO优化-搜索引擎营销推广 | 胀套-锁紧盘-风电锁紧盘-蛇形联轴器「厂家」-瑞安市宝德隆机械配件有限公司 | 餐饮加盟网_特色餐饮加盟店_餐饮连锁店加盟| 石家庄装修设计_室内家装设计_别墅装饰装修公司-石家庄金舍装饰官网 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库-首页-东莞市傲马网络科技有限公司 | 冷却塔改造厂家_不锈钢冷却塔_玻璃钢冷却塔改造维修-广东特菱节能空调设备有限公司 | 礼至家居-全屋定制家具_一站式全屋整装_免费量房设计报价 | 中图网(原中国图书网):网上书店,尾货特色书店,30万种特价书低至2折! | IP检测-检测您的IP质量 | 挤出熔体泵_高温熔体泵_熔体出料泵_郑州海科熔体泵有限公司 | 深圳成考网-深圳成人高考报名网| 防火门-专业生产甲级不锈钢钢质防火门厂家资质齐全-广东恒磊安防设备有限公司 | 日本SMC气缸接头-速度控制阀-日本三菱伺服电机-苏州禾力自动化科技有限公司 | 超声波成孔成槽质量检测仪-压浆机-桥梁预应力智能张拉设备-上海硕冠检测设备有限公司 | 继电器模组-IO端子台-plc连接线-省配线模组厂家-世麦德 |