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

<small id='8Tfuq'></small><noframes id='8Tfuq'>

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

        <tfoot id='8Tfuq'></tfoot>
      1. Android 地理圍欄(多邊形)

        Android Geofencing (Polygon)(Android 地理圍欄(多邊形))

              <tbody id='s6xnZ'></tbody>

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

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

                <bdo id='s6xnZ'></bdo><ul id='s6xnZ'></ul>
                  本文介紹了Android 地理圍欄(多邊形)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  如何從多個(gè)地理位置(經(jīng)緯度值)創(chuàng)建多邊形地理圍欄.此外,如何跟蹤用戶是進(jìn)入這個(gè)地理圍欄區(qū)域還是在 android 上退出這個(gè)區(qū)域.

                  How to create Polygon Geofence from multiple geo locations(long,lat values) . Also how to track user is entering into this geofence region or exiting from this region on android.

                  推薦答案

                  地理圍欄只是一個(gè)組成多邊形的緯度/經(jīng)度點(diǎn)的數(shù)組.獲得緯度/經(jīng)度點(diǎn)列表后,您可以使用點(diǎn)內(nèi)多邊形檢查來(lái)查看某個(gè)位置是否在多邊形內(nèi).

                  A geofence is simply an array of lat/long points that form a polygon. Once you have a list of lat/long points, you can use a point-inside-polygon check to see if a location is within the polygon.

                  這是我在自己的項(xiàng)目中用于對(duì)非常大的凹多邊形(20K+ 頂點(diǎn))執(zhí)行多邊形點(diǎn)檢查的代碼:

                  This is code I have used in my own projects to perform point-in-polygon checks for very large concave polygons (20K+ vertices):

                  public class PolygonTest
                  {
                      class LatLng
                      {
                          double Latitude;
                          double Longitude;
                  
                          LatLng(double lat, double lon)
                          {
                              Latitude = lat;
                              Longitude = lon;
                          }
                      }
                  
                      bool PointIsInRegion(double x, double y, LatLng[] thePath)
                      {
                          int crossings = 0;
                  
                          LatLng point = new LatLng (x, y);
                          int count = thePath.length;
                          // for each edge
                          for (var i=0; i < count; i++) 
                          {
                              var a = thePath [i];
                              var j = i + 1;
                              if (j >= count) 
                              {
                                  j = 0;
                              }
                              var b = thePath [j];
                              if (RayCrossesSegment(point, a, b)) 
                              {
                                  crossings++;
                              }
                          }
                          // odd number of crossings?
                          return (crossings % 2 == 1);
                      }
                  
                      bool RayCrossesSegment(LatLng point, LatLng a, LatLng b)
                      {
                          var px = point.Longitude;
                          var py = point.Latitude;
                          var ax = a.Longitude;
                          var ay = a.Latitude;
                          var bx = b.Longitude;
                          var by = b.Latitude;
                          if (ay > by)
                          {
                              ax = b.Longitude;
                              ay = b.Latitude;
                              bx = a.Longitude;
                              by = a.Latitude;
                          }
                              // alter longitude to cater for 180 degree crossings
                          if (px < 0) { px += 360; };
                          if (ax < 0) { ax += 360; };
                          if (bx < 0) { bx += 360; };
                  
                          if (py == ay || py == by) py += 0.00000001;
                          if ((py > by || py < ay) || (px > Math.max(ax, bx))) return false;
                          if (px < Math.min(ax, bx)) return true;
                  
                          var red = (ax != bx) ? ((by - ay) / (bx - ax)) : float.MAX_VALUE;
                          var blue = (ax != px) ? ((py - ay) / (px - ax)) : float.MAX_VALUE;
                          return (blue >= red);
                      }
                  }
                  

                  就程序流程而言,您需要后臺(tái)服務(wù)進(jìn)行位置更新,然后針對(duì)您的緯度/經(jīng)度多邊形數(shù)據(jù)執(zhí)行此檢查,以查看該位置是否在內(nèi)部.

                  In terms of program flow, you will want a background service to do location updates and then perform this check against your lat/long polygon data to see if the location is inside.

                  這篇關(guān)于Android 地理圍欄(多邊形)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Help calculating X and Y from Latitude and Longitude in iPhone(幫助從 iPhone 中的緯度和經(jīng)度計(jì)算 X 和 Y)
                  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(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)

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

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

                          <tbody id='GCiNO'></tbody>
                          <bdo id='GCiNO'></bdo><ul id='GCiNO'></ul>
                        • <tfoot id='GCiNO'></tfoot>

                            主站蜘蛛池模板: 欧美精品久久久久久久久老牛影院 | 欧美爱爱视频 | 一区二区久久精品 | 日本成人在线免费视频 | 欧美在线视频一区二区 | 亚洲大片一区 | 午夜看电影在线观看 | 亚洲精品一区二区三区 | 极品粉嫩国产48尤物在线播放 | 日韩高清中文字幕 | 久久久久免费精品国产 | 99热碰| 高清一区二区三区 | 亚洲精品性视频 | 久久一本 | 国产一区二区三区色淫影院 | 久久精品视频网站 | 日日噜噜夜夜爽爽狠狠 | 久久精品91 | 999久久久免费精品国产 | 99精品国自产在线 | 免费午夜视频 | 在线观看亚洲精品 | 一级做a毛片| 久久亚洲国产精品 | 一区二区三区免费看 | 国产视频三级 | 亚洲激精日韩激精欧美精品 | 免费看日韩视频 | 亚洲欧美视频一区 | 能看的av | 色综合久久久久 | 欧美性大战久久久久久久蜜臀 | 成人性视频免费网站 | 欧美中文字幕一区 | 美女在线视频一区二区三区 | 精品国产欧美日韩不卡在线观看 | 亚洲精品久久久久久一区二区 | 久草中文在线 | 欧美日韩在线免费观看 | 日本在线视 |