ramrocket
asked on
Latitude, Longitude, Center Point
Hi, I need to find out how to know if a given point expressed in actual latitude and longitude is inside a box. The box is also expressed in actual latitude and longitude:
UL_LON = upper let lon
UL_LAT = upper left lat, etc
(UL_LON, UL_LAT) (UR_LON, UR_LAT)
+------------------------- ---------- ---------- +
| |
| |
| + |
| (PT_LON,PT_LAT) |
| |
| |
+------------------------- ---------- ---------- +
(LL_LON, LL_LAT) (LR_LON, LR_LAT)
How do I find out if (PT_LON, PT_LAT) is inside the square.
thanks in advance.
UL_LON = upper let lon
UL_LAT = upper left lat, etc
(UL_LON, UL_LAT) (UR_LON, UR_LAT)
+-------------------------
| |
| |
| + |
| (PT_LON,PT_LAT) |
| |
| |
+-------------------------
(LL_LON, LL_LAT) (LR_LON, LR_LAT)
How do I find out if (PT_LON, PT_LAT) is inside the square.
thanks in advance.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
If you can approximate the sides with loxodromes
http://www.exaflop.org/docs/cgafaq/cga2.html#Subject%202.03:%20How%20do%20I%20find%20if%20a%20point%20lies%20within%20a%20polygon?
http://www.exaflop.org/docs/cgafaq/cga2.html#Subject%202.03:%20How%20do%20I%20find%20if%20a%20point%20lies%20within%20a%20polygon?
ASKER
ozo,
in the funtion:
int pnpoly(int npol, float *xp, float *yp, float x, float y)
what are the values in these arrays xp and yp???
in the funtion:
int pnpoly(int npol, float *xp, float *yp, float x, float y)
what are the values in these arrays xp and yp???
UL_LON
UR_LON
LR_LON
LL_LON
and
UL_LAT
UR_LAT
LR_LAT
LL_LAT
UR_LON
LR_LON
LL_LON
and
UL_LAT
UR_LAT
LR_LAT
LL_LAT
ASKER
ah got it.
ASKER