I'm just trying to find a single simple file (CSV or XML ideally) which has the latitude and longitude pairings for each of the 50 United States (plus DC, though the addition of provinces such as Puerto Rico and Guam, or even Canada and Mexico wouldn't be unwelcome).

Is there such a list available somewhere? I've tried searching and browsing OpenStreetMaps, downloading the US.zip from GeoNames, the Census website, etc., but everything seems to come in shape files and such which I'm not terribly familiar with.

My end goal (if it helps) is to simply look-up the state by latitude/longitude using my LAMP stack (Linux Apache (actually using Nginx) MySQL and PHP), though I will have 1000s of records per hour, so using an external web service isn't feasible.

  • If you've got shapefiles, converting those to bounding boxes should be pretty easy with QGIS or PyShp.
    – Mintx
    Commented Jan 4, 2017 at 19:07
  • That seems like re-inventing a wheel. I'm surprised if there isn't a list for this somewhere already...
    – Bing
    Commented Jan 4, 2017 at 19:24
  • The second hit for Googling "US state bounding boxes" gist.github.com/mishari/5ecfccd219925c04ac32
    – Mintx
    Commented Jan 4, 2017 at 19:32
  • Those are bounding boxes only, rather than border points, meaning the area inside of MA is going to include all of CT and RI. It might work for Colorado or Wyoming, but not for West Virginia or Michigan.
    – Bing
    Commented Jan 4, 2017 at 19:40
  • How are the boundaries packed in the eric.clst.org/wupl/Stuff/gz_2010_us_040_00_500k.json file? I would like to read it into python and draw maps for states. thank you!
    – user103949
    Commented Aug 17, 2017 at 18:52

4 Answers 4


From your comments, it looks like you'd like to convert those shapefiles to CSV.

As to why this data isn't readily available, it all depends on your application and what you want to do with the data, so what may work for one person may not work for another. For instance, if your accuracy needs to be better than 2 meters, then your resulting CSV/XML file is going to be huge.

If your data doesn't need to be detailed, then there are generalization techniques, but there are different levels of generalization, and it usually leaves gaps/overlaps at the borders, and that takes time to clean up.


There is a site Global Administrative Boundaries which maintains this sort of GIS information in several formats including several ESRI formats, KMZ, and spatialite databases. You can search and download either by country or the whole world. The KMZ file may work best for your needs, but I would also recommend setting up a MapServer (http://mapserver.org/input/vector/shapefiles.html) or GeoServer to serve the shapefiles since it's not overly difficult.


The only caveat is that it's for non-commercial use.


Here is what I was looking for:


I would paste the contents, but the file is over 2MB in size.


In R, this is available in ggplot2. It requires a little care if you want to draw it as a line plot due to states with multiple connected components.

states <- map_data("state")
states$subregion[is.na(states$subregion)] <- "none"
statelist <- unique(states$region)
plot(states[,1:2], t='n')
for (i in 1:length(statelist)) { 
  data.sub <- states[states$region == statelist[i],]
  regs <- unique(data.sub$subregion)
  for (j in 1:length(regs)) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.