Downloads: FREE, Public Domain databases

Geographic / Geopolitical

The Americas Open Geocode (AOG) is a public domain database providing geolocation and geopolitical data for the North and South American continent. The database is comprised of data collected and combined from national, state, county and municipal public domain sources, data generated by OpenGeoCode, and partnerships with businesses and institutional public domain sources.


There is a compelling need in the geolocation industry for a one stop source of all public domain geolocation data for point-of-interest (POI) of administrative boundaries, zip codes, significant buildings and corresponding commercial and government enterprises in the US and Canada.

A public domain open gecode database will benefit business and third party application developers by providing a single source (one-stop) access to all public domain geocoded data, use of the public domain data without restrictions, real-time querying and bulk caching of geocoded data, and creating derivative works.

Countries of the World (COW)

FIPS 10-4 to ISO 3166-1 Country Codes mapping

Map FIPS 10-4 2-letter country codes to the equivalent ISO 3166-1 alpha-2 2-letter country codes. Our semi-colon deliminated text file maps the FIPS 10-4 code (1st column) to the ISO 3166-1 alpha-2 code (2nd column) and alpha-3 (3rd column) equivalent, or to the inclusive (4th column) country.



Country Codes to Country Names mapping

Map ISO 3166-1 alpha-2, alpha-3 and numeric country codes to the corresponding country name. Our CSV semi-colon deliminated text file maps the ISO 3166-1 country codes to the ISO 3166-1, U.S. Board on Geographic Names (BGN), United Nations Group of Experts on Geographic Names (UNGEGN), and U.K. Permanent Committee on Geographic Names (PCGN) country names.



Below is a CSV dataset of the German Governments names of countries in German, which was scrapped from the Federal Foreign Office's page for visa requirements. It covers 198 countries.

HTML Forms - Input Selection: Countries of the World

Use these HTML form snippets in an HTML page for selecting a country from a list of countries of the world. The country names in the HTML form snippets conforms to either an ISO, BGN, PCGN or UNGEGN country names standard. Each form snippet is constructed as an HTML <select> tag, whose value is the selected country, consisting of an <option> tag per country.

The HTML forms below cover four of the six United Nations official languages (English, French, Spanish, Russian), and the local romanized language, in Gazetteer order.


ISO 639-1/2 Language Codes to Language Names

Map ISO 639-1/2 2 and 3-letterlanguage codes to the language name in English and French. Our semi-colon deliminated text file maps the ISO 639-1 2-letter codes (1st column) and 639-2 3-letter codes (2nd column) to the full language name in English (3rd column), and French (4th column).



List of Government Websites for the Countries of the World

This dataset consists of the most comprehensive list of government websites for all the countries and dependencies of the world.



Cities of the World

This dataset consists of the most comprehensive list of cities, administrative divisions and other populated places in the world. The data is compiled from:

  • United States: United States Geological Survey (USGS) Geographic Names Information Services (GNIS).
  • Other Countries: National Geospatial Intelligence Agency (NGA) Geographic Name Server (GNS).
The NGA/GNS database has been maintained by the NGA since 1994 and contains over 7 million geographic features and populated places records on all countries of the world. For non-US, geographic names are provided both in the local language and local script, as well as romanized and/or English forms of the name.

Many of the non-US entries in the dataset have multiple records, one per language (e.g., English and Spanish) or script (e.g, Arabic and Latin) that the feature (e.g., city) name is specified in. Multiple records for the same feature are identified by the same NGA GNS Unique Feature Identifier (UFI).



US City/ZipCodes Dataset

This (FREE) dataset is a CSV file of approxiamately all USPS postal codes with their corresponding cities and lat/lng. As many would understand, the USPS dataset is copyrighted and the free ZCTA data US Census from the US Census is an approximation.

We decided to use the following method to reverse build nearly the entire set. We got the US Department of Education's NCES dataset on all schools in the United States (103K schools), the US Housing and Development (HUD) dataset on single and multi-dwelling public housing and figure that 99% of postal codes would have at least on school and/or public housing unit. We used the address information to build a unique set of postal codes to cities. Statistics wise, there are approxiametely 41.5K unique postal codes. Our list has 28K - with some postal codes have multiple entries due to being in more than one city. The latitude/longitude coordinate is an average of the summation of all schools/housing units (POI) within the postal code. Have fun with our free dataset!



US State/Counties Dataset

This (FREE) dataset is a CSV file of US states with their corresponding counties and latitude/longitude area centroids. This dataset was derived from the US Census 2013 Gazetteer for Population Estimates of US Counties.



US State/Cities Dataset

This (FREE) dataset is a CSV file of US states with their corresponding cities and latitude/longitude area centroids. This dataset was derived from the US Census 2013 Gazetteer for Population Estimates of Places. The dataset contains both incorporated and unicorporated places.



US State/Counties/Cities Dataset

This (FREE) dataset is a CSV file of US states with their corresponding counties and corresponding cities. This dataset was derived from the US Census 2010 ANSI Code Reference for Places. The dataset contains both incorporated and unicorporated places.



US County Adjacency

This (FREE) dataset is a CSV file of US counties with their corresponding adjacent counties. This dataset was derived from the US Census 2010 Geography County Adjacency.



Haversine Function (Great Circle) in Multiple Programming Languages

The Haversine function is used to calculate the distance between two latitude/longitude points on the globe. The function was first published by Roger Sinnott in Sky & Telescope magazine in 1984 ("Virtues of the Haversine").


Other Code Samples

Javascript: Using Google Geocoding API to get Location from Postal Code

This code samnple demonstrates how to use the Google gecoding API in javascript to convert a postal code (such as one entered by a user in a form) to a latitude and longitude pair and display it. I've hard-coded a postal code in the onload=ShowLocation( '98607' ) event in the <body> tag. This event is called when the web page is loaded.

The function ShowLocation() uses sendRequest() to make an async call to the Google geocoding API. The call returns its results to the callback function DisplayAddress(). The response parameter is the value returned by the API call. In this case, it will be a JSON object. You can get a XML response by changing the 'json' parameter to 'xml' in the API call in ShowLocation.


Psuedo Code: Reducing a Set of Points to Single Point per Grid Partition with Tally

This psuedo code demonstrates how to reduce a set of points to a single point per grid partition while tally the number of points in the grip partition. This can be useful if you have a set of points where some areas are sparse and others are dense, but want an even distribution of displayed points (such as on a map).

To use the function, one passes the set of points and the number of partitions across one of the axis (e.g., X). The same partitioning will be used on the other axis (e.g., Y). So if one specified 3, then 9 (3*3) equal sized partitions would be made. The function first goes through the set of points to find the outermost X and Y (min and max) coordinates that bound the entire set. The distance between the outermost X and Y axis is then divided by the number of partitions to determine the grid size.

The function then steps through each grid partition and checks each point in the set whether it is within the grid partition. If the point is within the grid partition, it checks if this is the first point encountered in the grid partition. If yes, a flag is set to indicate that the first point has been found. Otherwise, not the first point in the grid partition, the point is removed from the set of points.

For each point that is found in the grid partition, the function increments a tally count. Finally, when the reduction/tallying is completed per grid partition, one can then visualize the tallied point (e.g., show marker on map at the single point with a tally indicator).




Government DataSets