• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🇺🇸 SQL dump of U.S. cities data containing latitude and longitude

U.S. Cities Database

The SQL file has 29.880 registered cities. All cities are located in the United States.

The SQL file contains two tables:

  • US_STATES: ID, STATE_CODE and STATE_NAME.

  • US_CITIES: ID, ID_STATE, CITY, COUNTY, LATITUDE and LONGITUDE.

The US_CITIES table has all (or almost all) cities from the United States.

Compatibility

The us_cities.sql file is compatible with MySQL. See sqlite for the sqlite3 compatible version.

Samples

US_STATES

ID STATE_CODE STATE_NAME
1 AL Alabama
2 AK Alaska
3 AZ Arizona

US_CITIES

ID ID_STATE CITY COUNTY LATITUDE LONGITUDE
1 2 Adak Aleutians West 55.999722 -161.20777
2 2 Akiachak Bethel 60.891854 -161.39233
3 2 Akiak Bethel 60.890632 -161.19932
4 2 Akutan Aleutians East 54.143012 -165.78536
5 2 Alakanuk Kusilvak 62.746967 -164.60228

Export Data

You can use the following SQL command to export the data to a CSV file.

SELECT
	US_CITIES.ID, US_STATES.STATE_CODE, US_STATES.STATE_NAME, US_CITIES.CITY, US_CITIES.COUNTY, US_CITIES.LATITUDE, US_CITIES.LONGITUDE
FROM
	US_STATES
INNER JOIN
	US_CITIES
ON
	US_STATES.ID = US_CITIES.ID_STATE
ORDER BY
	US_CITIES.ID ASC
INTO OUTFILE
	'C:/US_Cities.csv'
FIELDS TERMINATED BY
	';'
ENCLOSED BY
	''
LINES TERMINATED BY
	'\n';

For convenience, the generated CSV file is here.

License

This project was created under the MIT license.

If you find some inconsistent data, such as a duplicated city, please open an issue explaining what is happening or directly fix the problem and send a Pull Request.

References

This SQL dump was created based on the SQL dump that can be found at the following link: http://www.farinspace.com/us-cities-and-state-sql-dump/

CHANGELOG

  • The zip column was deleted.
  • Some duplicated cities were deleted.
  • All data were reorganized (rows and columns).
  • It was included the Puerto Rico state name that was missing in the original SQL.
  • It was included the US_STATES table.
  • Wade Hampton was renamed to Kusilvak.

More Repositories

1

awesome-mlops

😎 A curated list of awesome MLOps tools
Python
3,923
star
2

municipios-brasileiros

🏡 Dados relacionados aos municípios brasileiros
Python
1,084
star
3

algorithms-and-data-structures

🧮 Algorithms and Data Structures in several Programming Languages
Python
1,042
star
4

design-patterns-python

💻 Padrões de Projeto em Python
Python
500
star
5

steganography

🙈 Steganography: Hiding an image inside another
Python
341
star
6

awesome-dataops

😎 A curated list of awesome DataOps tools
Python
137
star
7

qt-examples-and-tutorials

☕ Qt - Examples and Tutorials
C
108
star
8

GoApiTutorial

📚 Building and Testing a REST API in GoLang using Gorilla Mux and MySQL
Go
103
star
9

boas-praticas-cpp

Guia Rápido de Boas Práticas em C++
C++
87
star
10

sunrisesunset

🌅 Go package that provides the sunrise and sunset equation
Go
76
star
11

lbph

Local Binary Patterns Histograms (LBPH) implementation in Go
Go
53
star
12

geocoder

🌎 GoLang package that provides an easy way to use the Google Geocoding API
Go
51
star
13

long-exposure

🎥 Creates a long exposure effect using Python and OpenCV
Python
41
star
14

Reconhecimento-Facial

Repositório utilizado para armazenar algoritmos de reconhecimento facial
Python
23
star
15

DBSCAN

📈 Implementação DBSCAN em C++
C++
14
star
16

SMTPClient

📫 A simple SMTP client to send e-mails using C++ and the Qt framework
C++
13
star
17

CodeCoverageExampleQt

Code Coverage with Qt 5 and GCOV on Mac OS
HTML
8
star
18

nomade

Python Migration Manager for Humans 🐫
Python
6
star
19

docker-images

🐳 Docker images repository
Dockerfile
6
star
20

vim-gpt

🤖 GPT plugin for Vim
Vim Script
5
star
21

tic-tac-toe

🎮 TIC TAC TOE
JavaScript
4
star
22

ipcv-snippets

🖼️ Image Processing and Computer Vision code snippets
Python
2
star
23

Pykuli

🐍 Python package inspired by Sikuli
Python
2
star
24

dotfiles

⚡ My environment configurations
Emacs Lisp
2
star
25

kelvins.github.io

http://kelvins.github.io/
SCSS
2
star
26

helm-charts

⚙️ Kubernetes Helm Charts
Smarty
2
star
27

kelvins

1
star
28

MapMalaria

Sistema MapMalária
JavaScript
1
star
29

functional-programming-in-scala

Functional Programming in Scala
1
star
30

ResizeMe

🎆 The simplest image resizing app!
Python
1
star
31

passager

🔒 A simple, secure and personal password manager
Go
1
star
32

imgproc

🗻 Go package that provides simple image processing functions
Go
1
star
33

K-Means

📉 Algoritmo K-Means em C++
C++
1
star
34

logo-bot

:octocat: A bot that automatically add logos to your images
Python
1
star