1

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 Jan 4 '17 at 19:07
  • That seems like re-inventing a wheel. I'm surprised if there isn't a list for this somewhere already... – Bing Jan 4 '17 at 19:24
  • The second hit for Googling "US state bounding boxes" gist.github.com/mishari/5ecfccd219925c04ac32 – Mintx Jan 4 '17 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 Jan 4 '17 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 Aug 17 '17 at 18:52
2

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.

0

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.

http://gadm.org/country

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

0

Here is what I was looking for:

https://web.archive.org/web/20130615162524/http://eric.clst.org/wupl/Stuff/gz_2010_us_040_00_500k.json

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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