Hiii, Help me out..I open a image which is map with points using opengl.The points which are on map is a huge set of data stored in a file.This file has 2 columns which is latitude & longitude of a region. Now Using GL_POINTS & GL_LINE i draw a polygon on this image. Now what i need is i want only points or data related to points from the file which are thier only inside polygon. I mean to say the points which i click on image forms a loop & i join this points using GL_LINE which form a polygon on the entire region of image.I want data of only those pints which are inside this polygon. Please help me out atleast give me few links.
i want a program or small function which takes data from the entire region data file & points clicked by user & then comparing this , it takes data from the file & stores data in another file such that for data which is only in the region of points or for data which is only inside the polygon.
In short i want program which stores the data in another file only polygon region’s data not the entire region of the file.
Please please Help me out.
For exampl:
Few lines of the file data are as follows
a.dat:
BDA 1908 8 20 9 53 0.00 32.0000N 89.0000E 60.0 0 0.00 0 0.00 0.00 6.60 0 7.00 7.00 0 bbb
BDA 1915 12 3 2 39 19.00 29.5000N 91.5000E 60.0 0 0.00 0 0.00 0.00 6.70 0 7.10 7.10 0 bbb
SIG 1927 5 22 0 0 0.00 36.0000N 96.0000E 0.0 0 0.00 0 0.00 0.00 7.50 0 8.00 8.00 0 bbb
BDA 1934 12 15 1 57 37.00 31.3000N 89.3000E 60.0 0 0.00 0 0.00 0.00 6.70 0 7.10 7.10 0 bbb
SIG 1937 1 7 0 0 0.00 35.5000N 98.0000E 0.0 0 0.00 0 0.00 0.00 7.10 0 7.60 7.60 0 bbb
LEE 1937 1 7 13 20 41.00 35.5000N 97.6000E 0.0 0 0.00 0 0.00 0.00 7.10 0 7.60 7.60 10 bbb
SIG 1947 7 29 0 0 0.00 28.5000N 94.0000E 60.0 0 0.00 0 0.00 0.00 7.30 0 7.80 7.80 0 bbb
BDA 1947 7 29 13 43 22.00 28.5000N 94.0000E 60.0 0 0.00 0 0.00 0.00 7.40 0 7.90 7.90 0 aaa
G-R 1950 8 15 14 9 30.00 28.5000N 96.5000E 25.0 0 0.00 0 0.00 0.00 8.10 0 8.70 8.70 10 aaa
ISS 1950 9 13 11 7 27.00 27.5000N 96.4000E 0.0 0 0.00 0 0.00 0.00 6.60 0 7.00 7.00 7 sss
G-R 1951 11 18 9 35 47.00 30.5000N 91.0000E 25.0 0 0.00 0 0.00 0.00 7.40 0 7.90 7.90 4 mmm
LEE 1951 11 18 9 35 50.00 31.1000N 91.4000E 0.0 0 0.00 0 0.00 0.00 7.50 0 8.00 8.00 0 ppp
G-R 1952 8 17 16 2 7.00 30.5000N 91.5000E 0.0 0 0.00 0 0.00 0.00 7.00 0 7.50 7.50 9 mmm
BDA 1963 4 19 7 35 24.00 35.8000N 96.9000E 33.0 0 0.00 0 0.00 0.00 6.60 0 7.00 7.00 0 lll
PDE 2001 11 14 9 26 10.01 35.9500N 90.5400E 10.0 0 0.00 0 0.00 7.80 8.30 0 0.00 8.30 0 ppp
Here the 8 & 9th column is latitude & longitude of a region. Using this columns & 19th column, their are points on the whole image.
Now i click on few points on the image, let it be for example 7 points i click & its values are
29.45, 89.43
32.47, 90.98
27.25, 95.63
27.29, 98.27
36.74, 96.32
31.90, 87.67
29.45, 89.43
Actu this points forms a polygon in the given region of the image which are in the given region of file. Now i want a program in such way that the points or the latitude & longitude only inside the polygon should be stored in another file or just tel me how to get those value on the screen or command promt.
The answer for the above example or the output file using above file a.dat & the 7 points are
BDA 1908 8 20 9 53 0.00 32.0000N 89.0000E 60.0 0 0.00 0 0.00 0.00 6.60 0 7.00 7.00 0 bbb
SIG 1927 5 22 0 0 0.00 36.0000N 96.0000E 0.0 0 0.00 0 0.00 0.00 7.50 0 8.00 8.00 0 bbb
BDA 1934 12 15 1 57 37.00 31.3000N 89.3000E 60.0 0 0.00 0 0.00 0.00 6.70 0 7.10 7.10 0 bbb
G-R 1950 8 15 14 9 30.00 28.5000N 96.5000E 25.0 0 0.00 0 0.00 0.00 8.10 0 8.70 8.70 10 aaa
ISS 1950 9 13 11 7 27.00 27.5000N 96.4000E 0.0 0 0.00 0 0.00 0.00 6.60 0 7.00 7.00 7 sss
Now please me out.
Actu i have a region full of data i.e from latitude 0 to 50 & longitude 50 to 120.
Now i am asking for few points & based on how many ever points i am entering the lat & long for those points, this x,y points or lat long form a closed loop or polygon inside the given region 0 to 50 & 50 to 120…Now what i need is only the data which is inside that polygon or points which form a loop…Please help me out with a simple code or send me few links related to it…
I am trying this from past few days…Not getting Help me out