[GIS] Mapping Longitude and Latitude to US state

latitude longitudepoint-in-polygonunited-states

Is there any database (Gov data or private) or web service that map Longitude and Latitude to US state?

I have the specific Longitude and Latitude of a location and would want to identify the state that this location is in. Then repeat this for thousands and millions of records.

Best Answer

Download the state boundary shapefiles from US Census bureau.

Load the polygon shapefiles into SQL using Shape2SQL.

If you don't already have a geography column on your points table, add it.

Do a spatial join using code similar to this.