Display image with latitude and longitude position like augmented reality in Android - android

I have an array of position with latitude and longitude that are around the current user position, and i want display an image for every position of the array, if the user is looking in that direction Smart Glasses with Android (Moverio BT-200). I have made some research and I think I have to work with the Azimuth, in this way:
Get the GPS position of the user
Get the Azimuth
Define a distance view
Calculate the point inside that triangle to know what image of the array show to the user
This is more or less the summary, but I have another question, how can I let the user for example see only an half the image if he is looking in one position and the half image is in the edge of the screen?
Or how can I show the image behind the user when him for example turn back and during the movement let see him other image in the other position in the range of the distance view?

Related

How to display location in a custom indoor map, given the coordinates X,Y

I want to create a map for an indoor location finding App. I have images of the building layouts and how they should look, but I don't know how to show the exact location given some coordinates (X,Y). I only need something simple.
I'm creating an indoor location finding app, based on WiFi signals. The algorithm part returns a pair of coordinates (X,Y), and I want to display the location somehow.
I really don't know how I should do this.
My first thoughts were to get the pixel coordinates of the (0,0) point on the image, and the distance in pixels between two points, i.e (0,0) and (0,1), (I know they are equidistant). The image, the pixel coordinates and distance are stored in an object.
Now, given a pair (X,Y) the object above, I can calculate on which pixel the location should fall on. But this isn't MATLAB, and I'm not sure how to edit it or if I can add a Pin or something on top of the image in order to show the location.
Example:
Here is an image of a building
I know for the point (0,0)(starting from bottom left) pixel coords are (47,223) and the distance between the points is 45px.
Given the coordinates (1,2.5), I have to show the estimated location. Which is the pixel (92,110) and have to highlight it somehow.
This is my only idea, as I'm pretty new to Android developement. It doesn't necessarily have to be like this, I just want to pinpoint a location given a pair of coords (X,Y). I'm open to suggestions.
Thank you for your time.

How can I get a correct coordinate of a wide road in Android

I hope to develop an location based android app to get current location coordinates and display landmarks near the location , the road you are traveling etc. My problem is that, if someone is traveling in a wide road -the left,right and middle coordinates of the road may vary.As a result of this it may give incorrect road name. Therefore how can I get a correct coordinate of that particular road. Can someone please help?
One Option: Image recognition. Determine the actual width of the road based on images and update your landmark positions accordingly.
Another option. I'm assuming you have the gps coordinates for the landmarks, why not just show the landmarks at the actual gps coordinate. If the coordinate is "off-screen" then have a bubble or box or an arrow pointing off screen towards the landmark until it is "on-screen"

Show current location of user on an offline static image (jpeg) - Android

Background / Concept: I want to create an application that can help user searching for specific things. Let say nearby restaurants. Here I want to include an offline map covering 1 km area around that restaurant, (its easy i can take snap of google map).
Problem: is it possible to indicate current user position on that static image file? I have some idea that I note the Lat / Long of all four corners of that image, take user current position, do some calculation and show the current spot.. But I m not sure where to start and if there is already a good optimized solution.
If I can show current user direction (heading) it will be awesome!
MORE CONCISE QUESTION:
I have a jpeg image (which is actually a street map) and I know lat / long of all four corners of image. How can i show current user location on that image?
P.S. The application is suppose to work without data connection, so I can't load google map etc
Lets say that user position is uLat and uLon, and the map have top left corner tlLat and tlLon, and bottom right corner brLat and brLon. Finally, map size is x and y pixels.
userX = x*(uLon-tlLon)/(brLon-tlLon);
userY = y-y*(uLat-brLat)/(tlLat-brLat);
This is an aproximation that only works for small distances (1 km should be fine) as it's not taking into consideration the earth curvature.
I'm not sure that's legal to use google map screenshot without authorization.
good luck.

How to update list view with compass heading like google places application in android

I am trying to display an arrow pointing towards destination locations on list view,I did this by calculating bearing between current and destination,but I need to update the arrow
when user rotates his device and as well as when user location changes,can anyone help me in doing this.Thanks...

Android: How To: display a map (still image file) with a moving current location pointer

I am trying to create a prototype that could guide a person to his destination place.
place is a wide building with several floors.
i can obtain/retrieve the maps (still images). e.g. current:1F destination:5F; so I can get the still images of 1st,2nd...5th floors (5 image files).
Scenario:
start the application
input the current location (or may automatically set using current location) & destination
click the search route button to search the maps to use (still images) & mark the current location & destination
update the current location upon moving/going to destination
Problem:
I just need to display 1 image file (each floor) at a time then move to other floor by using scroll bar. But.. don't know how to display it.
I can get the current location coordinate via WiFi but don't know how to put it into still image to mark the current location.
For sure there is already look a like sample application available.
Could you share the concepts/ideas or would you include the code snippets. Big Help with my thesis.
Any guidance on the right direction is appreciated.
You have a couple possibilities, create your own MapView like object to provide scrolling ot overlay your map on the Google Api. Example usage of the MapView Api is available through the Location dev guide.
To do this via your own View will be easier if you understand basic graphics programming and transformations for zoom and pan. (If you're good at math it will be no trouble to learn). Use an ImageView with android:scaleType="matrix" override the MotionEvent handler to get the touches then process them into a tranlation and zoom matrix.
To associate the indicator to the image make two pixels into anchor points that coorespond to a real life lat/long. Usually its (0,0) and (width,height) of a rectangular image. Make your life easier and make sure the images are to scale. Then using a second ImageView (for the indicator) draw it on top and move it to the correct place on the screen and make sure the background in this View is transparent as well as the background of your indicator or you'll have a rectangular block "halo".
Be sure to check the accuracies of each location given by the LocationManager.
Additional Content
onCurrentPosition(Location current){
double hypotenuse = upperLeft.distanceTo(current);
double bearing = upperLeft.bearingTo(current);
double currentDistanceX = Math.cos(bearing) * hypotenuse;
// "percentage to mark the position"
double currentPixelX = (currentDistanceX / upperLeft.distanceTo(lowerRight) * Math.cos(upperLeft.bearingTo(lowerRight))) * mapWidth;
moveIndicatorX(currentPixelX);
}

Categories

Resources