JasonCannon
IS-IT--Management
I am trying to find the best method in VFP to check a given set of latitude and longitude coordinates.
Starting simple and just want to confirm that a set is in a given US state. And so far I have a table of the northern and southern latitude points and the eastern and western longitude points for each US state.
I can confirm if the given lat and long are or are not within the given state, but if they are not within that state, how can I find out which state they are in?
Table
State : North : South : East : West
VA : 39.4667 : 36.5333 : -75.2500 : -83.6833
Given Lat & Long
VA : 43.9454 : -90.7956
I use below to check if the lat and long are/are not in the given state:
( (lat > table.south AND lat < table.north) AND (long > table.west AND long < table.east) )
I cannot seem to figure out the math to find the state given the lat and long.
Any thoughts, suggestions would be very much appreciated.
"..if you give a man a fish he is hungry again in an hour. If you teach him to catch a fish you do him a good turn."
-- Anne Isabella Thackeray Ritchie.
Starting simple and just want to confirm that a set is in a given US state. And so far I have a table of the northern and southern latitude points and the eastern and western longitude points for each US state.
I can confirm if the given lat and long are or are not within the given state, but if they are not within that state, how can I find out which state they are in?
Table
State : North : South : East : West
VA : 39.4667 : 36.5333 : -75.2500 : -83.6833
Given Lat & Long
VA : 43.9454 : -90.7956
I use below to check if the lat and long are/are not in the given state:
( (lat > table.south AND lat < table.north) AND (long > table.west AND long < table.east) )
I cannot seem to figure out the math to find the state given the lat and long.
Any thoughts, suggestions would be very much appreciated.
"..if you give a man a fish he is hungry again in an hour. If you teach him to catch a fish you do him a good turn."
-- Anne Isabella Thackeray Ritchie.