Determining the US State from Latitude and Longitude

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tpmcd
    New Member
    • Sep 2007
    • 2

    Determining the US State from Latitude and Longitude

    As a part of a larger project I'm looking for methods or examples of how to determine which of the 50 US States a vehicle is located in given its latitude and longitude. More detailed information like city, county, etc. isn't required but I can always toss out extra stuff.

    Ultimately the "solution" will become a procedure or function that is incorporated into a stand alone (non-web based) program but there is a database available if lookup tables or other data sets are needed.

    Thanks for any pointers or suggestions.

    Tim
    Last edited by tpmcd; Sep 11 '07, 08:32 PM. Reason: Corrected spelling
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You need to store all the Latitude and Longitude related data in the database table . Then you need to retrive the info implement the logic . I think u need to check for the intersection of Latitude and Longitude for the same.

    Comment

    • tpmcd
      New Member
      • Sep 2007
      • 2

      #3
      Originally posted by debasisdas
      You need to store all the Latitude and Longitude related data in the database table . Then you need to retrive the info implement the logic . I think u need to check for the intersection of Latitude and Longitude for the same.
      Agreed. My search so far looks like the state boundaries are typically available as "shape files" used by various creators of Geographic Information Systems. The solution it seems will be to store that data in the database and create a query that can be used to determine which shape (state) encloses the specific coordinates being checked.

      Tim

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by tpmcd
        As a part of a larger project I'm looking for methods or examples of how to determine which of the 50 US States a vehicle is located in given its latitude and longitude. More detailed information like city, county, etc. isn't required but I can always toss out extra stuff.
        Well you do need the lat/long points that make up the border polygon of a state.
        Determining in which polygon (state) a certain pont lies, isn't that much of a problem.

        kind regards,

        Jos

        Comment

        • Shashi Sadasivan
          Recognized Expert Top Contributor
          • Aug 2007
          • 1435

          #5
          Google maps
          yahoo maps
          Microsoft live maps
          They all have API,s...free to use (including microsofts...al l are implemented in javascripts but you can get the equivalent work in other languages done from some open source developers)

          Cheers

          Comment

          • nick b
            New Member
            • Dec 2008
            • 1

            #6
            does anyone know of a site where i can download the lat/long of each state border in a data set?

            Comment

            • RedSon
              Recognized Expert Expert
              • Jan 2007
              • 4980

              #7
              You can do a google search for GIS Data and see if any of those are what you are looking for.

              Comment

              Working...