Find the State given Latitude and Longitude Coordinates

后端 未结 4 1003
一向
一向 2021-02-06 16:14

I have a set of 900 Latitude and Longitude Coordinates-- I need a relatively simple method for finding the \'State\' referred to by these coordinates. If it helps, the data is

4条回答
  •  广开言路
    2021-02-06 16:34

    Try to use the average values as provided here. With a bit of luck, most of your 900 coordinate pairs belong to the state with the nearest center. Calculation of distances between longitude/latitude locations is explained here.

    An alternative would be to use a ZIP table with US postcodes as provided here. Once you know the postcode, you know the state, don't you? I'm not sure, but each state has an interval of ZIP codes. Once you know the ZIP code of a location, you can find the interval and the state it belongs to.

    A list of coordinates of US locations could help to get a more exact allocation: http://www.bcca.org/bahaivision/fast/latlong_us.html Find the nearest location in the list and take its state as result.

提交回复
热议问题