
A border is a line either in real or artificial that splits up the geographical areas. Borders are the political boundaries that separate countries, regions, cities and towns. A border outlines the area that is controlled by a specific governing body and only the government of the area can generate and impose laws within its borders.
GeoDataSource Country Borders is a free data that provides you with a complete list of countries and the associated land border countries also known as the neighboring countries. The data comes in the form of the CSV format which you can easily import into any relational database for query. Furthermore, this data use ISO3166-1 for the country code thus allowing you to retrieve and use the information with ease.
Example of Country Borders
From the below table, we know that France and Spain share borders with Andorra.
country_code | country_name | country_border_code | country_border_name |
AD | Andorra | FR | France |
AD | Andorra | ES | Spain |
Data Fields
Below are the data fields for the Country Borders database.
Field Name | Description |
country_code | Two-character country code based on ISO 3166. |
country_name | Name of country. |
country_border_code | Two-character country code based on ISO 3166. |
country_border_name | Name of country border. |
Data Table
In order to get the Country Borders information, the country_borders
table can be created and loaded by the following code in MySQL.
-- Create table "country_borders"
CREATE TABLE `country_borders`(
`country_code` VARCHAR(2),
`country_name` VARCHAR(100),
`country_border_code` VARCHAR(2),
`country_border_name` VARCHAR(100),
PRIMARY KEY (`country_code`, `country_border_code`),
INDEX `idx_country_code` (`country_code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Load data into table
LOAD DATA LOCAL
INFILE 'GEODATASOURCE-COUNTRY-BORDERS.CSV'
INTO TABLE `country_borders`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;
Licensing
The Country Borders data is licensed under Creative Commons Attribution-ShareAlike 4.0 International License. It is free for personal or commercial use with attribution required by mentioning the use of this data as follows,
This site or product includes Country Borders data available from https://www.geodatasource.com.
For more details about the Country Borders databases, you can visit https://www.geodatasource.com/addon/country-borders to learn more about the information provided.