[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Latitude, Longitude, Center Point

Posted on 2006-03-22
6
Medium Priority
?
696 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
Comment
Question by:ramrocket
  • 3
  • 3
6 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 800 total points
ID: 16261795
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

by:ramrocket
ID: 16262074
Can you please provide me with a formula to do this.
0
 
LVL 85

Expert Comment

by:ozo
ID: 16262217
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ramrocket
ID: 16262513
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 85

Expert Comment

by:ozo
ID: 16262829
UL_LON
UR_LON
LR_LON
LL_LON
and
UL_LAT
UR_LAT
LR_LAT
LL_LAT
0
 

Author Comment

by:ramrocket
ID: 16262861
ah got it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Suggested Courses
Course of the Month17 days, 22 hours left to enroll

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

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

Join & Ask a Question