Using Latitude and Longitude to get the name of a state

  • Hi everyone!

    I have been plugging away at this for a bit, and I am curious if there are any methods, functions, code, etc. to plug in latitude and longitude coordinates and get the name of a state as a result.

    I have tried using the geography type and its "functions" to no avail.

    Thanks in advance!

    Kat

  • To start, you would need a reference table mapping the longitude and latitude boundaries of each state, wouldn't you?

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Yes, I would.

    I am mostly just trying to figure out the best way to go about this.

    The database I am using is from another company that generates reports for us to run, so I am not extremely familiar with it yet.

    Would I need to create one of those reference tables? I don't think this database has one.

    Sorry if I am asking stupid questions, and I really appreciate your time.

    Kat

  • I've done this before and Eric has it exactly right. Search the web for a zip code database; there are several available.

    Once you have it, you can import it into a table. From there, querying the state, etc. is pretty simple.

  • Thank you.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply