Geography Importer parses United States census data and imports the states, cities, and their relationships into a Core Data SQLite file, which can be used in iPhone or Mac apps.
The project is broken into two parts:
Census Parser. Contains the most recent census population data and two python scripts for parsing the census data and exporting as CSV files for states and cities.
Geography Importer. A Mac application that imports the CSV files generated from Census Parser into a Core Data SQLite file. This file can be added to any iPhone or Mac project.
Please let me know of any missing cities or other issues. Better yet, fork and make the changes!
In the terminal:
cd into the CensusParser directory
You will now have two new files: states.csv and cities.csv.
In the GeographyImporter project:
Build and run
Select your states.csv file and click Import.
Select your cities.csv file and click Import.
Close the app.
You will find the generated SQLite file in ~/Library/Application Support/GeographyImporter/Geography.sqlite
You can configure the population threshold for included cities in cityParser.py.
This project is released under the MIT license. See the LICENSE file included in the project for more details.