I am making a program in which you can click on a map to see a “close-up” around it, for example, on Google Maps.
When the user clicks on the map, he gets the X and Y coordinates where they clicked.
Suppose I have an array of Boolean objects, where these images are in close view:
public static boolean[][] view_set=new boolean[Map.width][Map.height]; //The array of where pictures are. The map has a width of 3313, and a height of 3329.
The program searches the folder where the images are called the X and Y coordinates, where they were taken on the map. The folder contains the following images (and much more, but I will list only five):
2377,1881.jpg, 2384,1980.jpg, 2389,1923.jpg, 2425,1860.jpg, 2475,1900.jpg
It means that:
view_set[2377][1881]=true; view_set[2384][1980]=true; view_set[2389][1923]=true; view_set[2425][1860]=true; view_set[2475][1900]=true;
If the user clicks on X and Y, for example, 2377.1882, then I need a program to find out which image is closer (the answer in this case will be 2377.1881).
Any help would be appreciated, thanks.
java algorithm computational-geometry
Runis
source share