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

  • <tfoot id='CMk9c'></tfoot>
    <legend id='CMk9c'><style id='CMk9c'><dir id='CMk9c'><q id='CMk9c'></q></dir></style></legend>

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

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

        幫助從 iPhone 中的緯度和經(jīng)度計算 X 和 Y

        Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計算 X 和 Y)
          <bdo id='0qXmR'></bdo><ul id='0qXmR'></ul>
          <legend id='0qXmR'><style id='0qXmR'><dir id='0qXmR'><q id='0qXmR'></q></dir></style></legend>

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

                  本文介紹了幫助從 iPhone 中的緯度和經(jīng)度計算 X 和 Y的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在 iPhone 上使用自定義地圖時,我陷入了某種地理位置的困境.問題是:我有一個 UIScrollView 和一個 UIImageView ,其中包含用于展覽會的自定義地圖圖像,以及所有展位位置等.我最大的問題是我打算使用地理定位來定位該地圖內(nèi)的人.當我嘗試獲取給定緯度和經(jīng)度的像素位置時,問題就開始了.我有幾個地面控制點作為參考,甚至設法計算了我的參考點和當前位置之間的角度.問題是我無法將像素距離與使用地理位置坐標計算的距離相關聯(lián).

                  I'm stuck into some kind of geolocation limbo using a custom map with iPhone. The problem is: I have an UIScrollView and an UIImageView with a image of a custom map for a fair, with all stand locations and so on. My biggest problem is that I intend to use geolocation in order to locate the person inside that map. The problem begins when I try to get the pixel location of a given latitude and longitude. I have several ground control points as reference and even managed to calculate the an angle between my reference spot and the current location. The problem is that I can't correlate the distance in pixels with a distance calculated with the geolocation coordinates.

                  我試圖將它們關聯(lián)如下:

                  I am trying to relate them as follows:

                  計算地圖中已知點的距離(以像素為單位).使用兩個參考點的矢量距離計算來計算距離.等于上面兩個以找到與參考的實際距離.

                  Calculating the distance in pixels of a known point in my map. Calculating the distance using vector distance calculation for two reference points. Equaling the two above to find the actual distance from the reference.

                  但我根本沒有成功......

                  But I am having no success at all...

                  使用余弦定律,我可以找到可以給出 X 和 Y 投影的角度,但我找不到正確相乘的比例.我猜是因為緯度和經(jīng)度以度數(shù)給出并且是非線性的,但是我有一個很小的點,我可以將它近似為線性點.

                  Using the law of cosines, I can find the angle that will give my projections of X and Y but I can't find a scale to multiply correctly. I guess is because latitude and longitude are given in degrees and are non-linear, but I have such a small spot that I can aproximate it as linear spot.

                  我不能在 MKMapKit 中使用疊加圖像,因為我必須水平使用地圖,而在谷歌地圖中,??同一個地方向左旋轉幾度.

                  I can't use an overlay image in MKMapKit because I have to use the map horizontally and in google maps, the same place is rotate several degrees to the left.

                  更新:

                  關注本網(wǎng)站:http://www.movable-type.co.uk/scripts/latlong.html,我可以使用 Haversine 公式計算距離,但作為下面的方向,我發(fā)現(xiàn)我以錯誤的方式計算角度.我將不得不找到另一種計算角度的方法.

                  Following this site: http://www.movable-type.co.uk/scripts/latlong.html, i could calculate the distance using the Haversine formula, but as orientation bellow, i found out that I was calculating the angle in a wrong way. I will have to find another way to calculate the angle.

                  推薦答案

                  我會通過假設平面地球近似并使用矢量代數(shù)將 lat,lon 空間中的角度和距離與 x,y 像素空間相關聯(lián)來做到這一點.

                  I would do this by assuming flat earth approximation and use vector algebra to relate angles and distances in the lat,lon space to the x,y pixel space.

                  例如:

                  我假設您知道左下角和右下角的緯度、經(jīng)度.還假設您的公平地圖不在兩極附近并且面積相當小.

                  I am assuming you know the lat,lon for the bottom left and bottom right corners. Also assuming your fair map isn't near the poles and is fairly small in area.

                  選擇一個坐標系,比如左下角,已知 lat,lon 為 0,0 像素.在下面的偽代碼中調(diào)用了 lat1,lon2

                  Pick a coordinate system say bottom left corner with known lat,lon at 0,0 pixels. Called lat1,lon2 in following pseudo code

                  計算從右下角lat2,lon2到左下角lat1,lon1的向量1

                  Compute vector 1 from the bottom right lat2,lon2 to the bottom left lat1,lon1

                  使用簡單的投影xl=lon,yl=lat,然后向量1 = (lon2 - lon1)i + (lat2-lat1)j

                  Using simple projection xl=lon, yl=lat, then vector 1 = (lon2 - lon1)i + (lat2-lat1)j

                  從你想要的人的緯度,經(jīng)度位置計算向量 2 (latp,lonp) 到地圖左下角的點 lat1,lon1

                  Compute vector 2 from the lat,lon position of person you want (latp,lonp) to put on the map to the bottom left point lat1,lon1

                  使用向量點積得到向量1和2之間的角度.

                  Use vector dot product to get the angle between vector 1 and 2.

                  通過等角投影計算緯度、經(jīng)度空間中的距離:

                  Compute the distance in lat,lon space via equirectangular projection:

                  p1 = (lonp - lon1) cos ( 0.5*(latp+lat1) ) (convert lat/lon to radians)
                  p2 = (latp - lat1)
                  distance = R * sqrt( p1*p1 + p2*p2)
                  use R = 6371000 and your distance will be in meters
                  

                  現(xiàn)在將此距離縮放到您的地圖比例

                  Now scale this distance to your map scale

                  此時,您已經(jīng)有了像素空間中該點的極坐標

                  At this point, you have polar coordinates of the point in pixel space

                  您現(xiàn)在進行極坐標到矩形的轉換;x = r cos(角度), y = r sin(角度)

                  you now do a polar to rectangular conversion; x = r cos(angle), y = r sin(angle)

                  r 是縮放距離(即像素空間中的距離),angle 是上面向量 1 和 2 之間的角度

                  r is the scaled distance (i.e. distance in pixel space) and angle is the angle between vector 1 and 2 above

                  作為一個健全的檢查,您可以計算從左上角到左下角創(chuàng)建的緯度、經(jīng)度向量的角度,從右下角到左下角點綴.如果角度不接近 90 度,則可能存在太多失真.

                  As a sanity check, you could compute the angle of the lat,lon vectors created from the top left to bottom left dotted with the bottom right to bottom left. If the angle isn't close to 90 degrees, there may be too much distortion for your purposes.

                  這篇關于幫助從 iPhone 中的緯度和經(jīng)度計算 X 和 Y的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  CLLocation returning negative speed(CLLocation 返回負速度)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡提供商)
                  Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數(shù)據(jù)中的位置?)
                  <i id='ZSmdq'><tr id='ZSmdq'><dt id='ZSmdq'><q id='ZSmdq'><span id='ZSmdq'><b id='ZSmdq'><form id='ZSmdq'><ins id='ZSmdq'></ins><ul id='ZSmdq'></ul><sub id='ZSmdq'></sub></form><legend id='ZSmdq'></legend><bdo id='ZSmdq'><pre id='ZSmdq'><center id='ZSmdq'></center></pre></bdo></b><th id='ZSmdq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZSmdq'><tfoot id='ZSmdq'></tfoot><dl id='ZSmdq'><fieldset id='ZSmdq'></fieldset></dl></div>
                  <legend id='ZSmdq'><style id='ZSmdq'><dir id='ZSmdq'><q id='ZSmdq'></q></dir></style></legend>

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

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

                      <tfoot id='ZSmdq'></tfoot>
                        <tbody id='ZSmdq'></tbody>

                          • 主站蜘蛛池模板: www.久久久久久久久久久 | 亚洲综合一区二区三区 | 亚洲免费视频在线观看 | 欧美在线观看黄色 | 久久久久国产成人精品亚洲午夜 | av免费观看在线 | 日韩午夜在线观看 | 人人鲁人人莫人人爱精品 | 亚洲国产成人av好男人在线观看 | 日韩在线观看精品 | 久久99精品久久久久婷婷 | 91麻豆精品国产91久久久久久 | 一二区成人影院电影网 | 久草热8精品视频在线观看 午夜伦4480yy私人影院 | 黄网站在线播放 | 国产专区在线 | 久久99深爱久久99精品 | 999精品网 | 欧美白人做受xxxx视频 | 亚洲福利精品 | 久久九九影视 | 自拍偷拍欧美 | 欧美激情精品久久久久久变态 | 国产日韩精品视频 | 欧美午夜在线 | 日本一区二区三区在线观看 | 亚洲欧美日韩系列 | 黄网免费 | 国产精品久久久久久久久久久久久久 | 成人福利影院 | 日韩免费视频一区二区 | 天天操操| 欧美精品成人一区二区三区四区 | 精品中文在线 | 国产免费一区二区 | 99久久99热这里只有精品 | 成年人视频在线免费观看 | 日韩欧美一区二区三区免费观看 | 欧美激情视频网站 | 免费毛片在线 | 午夜无码国产理论在线 |