Solved

# Latitude, Longitude, Center Point

Posted on 2006-03-22
609 Views
Last Modified: 2008-02-01
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.
0
Question by:ramrocket
6 Comments

LVL 84

Accepted Solution

If the sides of the square can be sufficiently approximated by loxodromes, you can use any point in polygon algorithm.
If they follow great circles, it can get a little more interesting near the edges.
0

Author Comment

Can you please provide me with a formula to do this.
0

LVL 84

Expert Comment

0

Author Comment

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???
0

LVL 84

Expert Comment

UL_LON
UR_LON
LR_LON
LL_LON
and
UL_LAT
UR_LAT
LR_LAT
LL_LAT
0

Author Comment

ah got it.
0

## Join & Write a Comment Already a member? Login.

### Suggested Solutions

Title # Comments Views Activity
Michel Meyer experiments 40 194
Frequency distribution 6 35
Probability Distribution 8 41
Functions 7 45
Introduction On a scale of 1 to 10, how would you rate our Product? Many of us have answered that question time and time again. But only a few of us have had the pleasure of receiving a stack of the filled out surveys and being asked to do somethi…
Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

#### 730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!