简体   繁体   中英

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). 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). I want this image's coordinates to correspond to/mirror the gps coordinates of the actual area. 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? 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? 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. You don't need to iterate over all possible values in that area, but just take some Min and Max .

For ex. taking Image with size 500x500 , and then bottom left side will have coordinates 30,400 and top right 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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