久久久久久久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)度計(jì)算 X 和 Y

        Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計(jì)算 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)度計(jì)算 X 和 Y的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

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

                  I am trying to relate them as follows:

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

                  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 投影的角度,但我找不到正確相乘的比例.我猜是因?yàn)榫暥群徒?jīng)度以度數(shù)給出并且是非線性的,但是我有一個很小的點(diǎn),我可以將它近似為線性點(diǎn).

                  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 中使用疊加圖像,因?yàn)槲冶仨毸绞褂玫貓D,而在谷歌地圖中,??同一個地方向左旋轉(zhuǎn)幾度.

                  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.

                  更新:

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

                  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è)平面地球近似并使用矢量代數(shù)將 lat,lon 空間中的角度和距離與 x,y 像素空間相關(guān)聯(lián)來做到這一點(diǎ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.

                  例如:

                  我假設(shè)您知道左下角和右下角的緯度、經(jīng)度.還假設(shè)您的公平地圖不在兩極附近并且面積相當(dā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.

                  選擇一個坐標(biāo)系,比如左下角,已知 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

                  計(jì)算從右下角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)度位置計(jì)算向量 2 (latp,lonp) 到地圖左下角的點(diǎn) 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

                  使用向量點(diǎn)積得到向量1和2之間的角度.

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

                  通過等角投影計(jì)算緯度、經(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)有了像素空間中該點(diǎn)的極坐標(biāo)

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

                  您現(xiàn)在進(jìn)行極坐標(biāo)到矩形的轉(zhuǎ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

                  作為一個健全的檢查,您可以計(jì)算從左上角到左下角創(chuàng)建的緯度、經(jīng)度向量的角度,從右下角到左下角點(diǎn)綴.如果角度不接近 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.

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

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

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  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 返回負(fù)速度)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  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>

                          • 主站蜘蛛池模板: 青青国产 | 亚洲视频在线观看一区 | 成人在线免费看 | 国产无遮挡又黄又爽又色 | 亚洲视频在线看 | 欧美日韩在线看 | 欧美大白屁股 | 亚洲视频在线免费观看 | 日韩精品国产精品 | 国产二区精品 | 国产伊人网 | 台湾av在线 | 国产视频一区二区三区四区 | 免费网站av | 亚洲综合伊人 | 欧美视频免费在线观看 | 特级黄色大片 | 激情六月婷婷 | 99久久视频 | 免费网站观看www在线观看 | 黄色一级免费看 | 中文字幕永久免费 | 日韩一区二区中文字幕 | 超碰成人网| 色妞色视频一区二区三区四区 | 亚洲精品乱码久久久久久蜜桃91 | 伊人国产在线 | 成人一级毛片 | 成人免费视频视频 | 亚洲精品一区二区三区在线观看 | 在线观看av网站 | 国产精品美女在线观看 | 精品国产毛片 | 日本国产欧美 | 依人在线| 亚洲精品a | 人人看人人爱 | 波多野一区 | 亚洲精品乱码久久久久久蜜桃91 | 亚洲天堂男人 | 久草网在线|