简体   繁体   English

带有用户当前gps位置的Android画布图像?

[英]Android canvas image with user's current gps location?

I am working on an android application that needs to keep track of a person's gps loaction inside a rectangular area (say 500X600 meters). 我正在开发一个Android应用程序,该应用程序需要跟踪一个矩形区域(例如500X600米)内某个人的GPS位置。 I don't want to view the location on google maps or osm rather I have an image of that area as my activity's canvas image (it covers the whole space). 我不想在google地图或osm上查看位置,而是将该区域的图像作为我的活动的画布图像(它覆盖了整个空间)。 I want this image's coordinates to correspond to/mirror the gps coordinates of the actual area. 我希望此图像的坐标对应于/镜像实际区域的gps坐标。 I will have physical markings in that area so that I can test the acurracy of the person's gps location when they move inside that area.How can I have this gps location tracking onto the canvas image view? 我将在该区域中进行物理标记,以便在人员进入该区域时测试其gps位置的精确度。如何在画布图像视图上跟踪此gps位置? I am also not sure if geofencing can help much or if at all it is required because that will help detect when the person has entered or exited that area but not their position on the activity image that mirrors their actual location inside the geographical area. 我也不确定地理围栏是否可以提供很大帮助,或者根本不需要,因为这将有助于检测该人何时进入或离开该区域,而不是检测他们在活动图像上的位置(该位置反映了该地理区域内的实际位置)。

For visual representation, here is an image . 为了直观表示,这是一张图片 There exists a rectangular park with different small rectangular areas inside it and the red arrow represents the person's location inside a small area inside the park. 有一个矩形公园,里面有不同的小矩形区域,红色箭头表示人在公园内小区域内的位置。 This image is my activity's canvas view and I want the red arrow marker to move to the correct smaller areas when the person moves inside the park. 此图像是我的活动的画布视图,当人在公园内移动时,我希望红色箭头标记移至正确的较小区域。

Is there any library or sdk available that can be used? 是否有任何可用的库或SDK? or is there any other way to solve this issue? 还是有其他方法可以解决此问题?

It's possible to map each position on the image by X,Y location, to the real GPS coordinates. 可以通过X,Y位置将图像上的每个位置映射到真实的GPS坐标。 You don't need to iterate over all possible values in that area, but just take some Min and Max . 您无需遍历该区域中的所有可能值,而只需采用MinMax

For ex. 对于前。 taking Image with size 500x500 , and then bottom left side will have coordinates 30,400 and top right 30,780 . 以图像的尺寸500x500 ,然后底部左侧有坐标30,400和右上30,780 You can just take fraction on whole pixels of your image. 您可以只对图像的整个像素取小数。 Then mapping values from GPS to the Image and locate custom marker on location . 然后将值从GPS映射到图像,然后在位置上定位自定义标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM