3

I exported the US.zip, allcountries.zip and the cities1000.zip file from geonames.org with the intention of using it for a list of cities, states and longitude/latitude info in the US. I noticed after looking through the data that there is a whole lot more than just cities and states. Ex. Here is one row

7534318              The San Francisco School              The San Francisco School              NULL     37.73275               -122.41167         S             SCH        US          NULL     CA          075        NULL     NULL     0             10               19           America/Los_Angeles      NULL

This contains other data about some data point in San Francisco, CA for a school. Although this is nice it seems that if all I want is city/state/country/lat/long data then it will be very hard to filter this data for just what I’m looking for.

My question. If all I want is a list of cities in the US with their state and long/lat information is there an easy way to get it from http://download.geonames.org/export/dump/ data export dump files? It doesn't seem like there is one specific column that has city names?

Thank you for any help!

Marc B
  • 356,200
  • 43
  • 426
  • 500
chuckd
  • 13,460
  • 29
  • 152
  • 331
  • Since you haven't mentioned any programming languages, how you plan to do the filtering, etc... this isn't a programming question, and therefor offtopic. – Marc B Jun 10 '14 at 21:42
  • I'll be using c# and javascript/html/css. – chuckd Jun 10 '14 at 22:41

1 Answers1

2

the main allcountries.zip, XX.zip contains all city, county, state, country location in addition to all land features, POI etc.

If you just want city, county (region), state, lat, lng, you can just use the postalcode zips. http://www.geonames.org/export/zip

If you want to use allCountries.zip, you can filter your query to include a specific feature type, listed here: http://www.geonames.org/export/codes.html#P.PPL

SELECT * FROM yourtable WHERE feature_code = "PPL";
steve
  • 1,786
  • 1
  • 15
  • 29