{"id":674,"date":"2022-04-21T00:00:00","date_gmt":"2022-04-21T00:00:00","guid":{"rendered":"https:\/\/wp3.geodatasource.com\/tutorials\/what-is-the-country-borders-data\/"},"modified":"2022-04-21T00:00:00","modified_gmt":"2022-04-21T00:00:00","password":"","slug":"what-is-the-country-borders-data","status":"publish","type":"docs","link":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/","title":{"rendered":"What is the Country Borders data"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png\" alt=\"What is the Country Borders data\" class=\"wp-image-397\" width=\"800\" height=\"400\" srcset=\"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png 1200w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-300x150.png 300w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-1024x512.png 1024w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-768x384.png 768w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-50x25.png 50w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-920x460.png 920w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-600x300.png 600w, https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img-320x160.png 320w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>GeoDataSource <strong>Country Borders<\/strong> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example of Country Borders<\/h2>\n\n\n\n<p>From the below table, we know that <strong>France<\/strong> and <strong>Spain<\/strong> share borders with <strong>Andorra<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td><strong>country_code<\/strong><\/td><td><strong>country_name<\/strong><\/td><td><strong>country_border_code<\/strong><\/td><td><strong>country_border_name<\/strong><\/td><\/tr><\/thead><tbody><tr><td>AD<\/td><td>Andorra<\/td><td>FR<\/td><td>France<\/td><\/tr><tr><td>AD<\/td><td>Andorra<\/td><td>ES<\/td><td>Spain<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Data Fields<\/h2>\n\n\n\n<p>Below are the data fields for the <strong>Country Borders<\/strong> database.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td><strong>Field Name<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><\/thead><tbody><tr><td>country_code<\/td><td>Two-character country code based on ISO 3166.<\/td><\/tr><tr><td>country_name<\/td><td>Name of country.<\/td><\/tr><tr><td>country_border_code<\/td><td>Two-character country code based on ISO 3166.<\/td><\/tr><tr><td>country_border_name<\/td><td>Name of country border.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Data Table<\/h2>\n\n\n\n<p>In order to get the <strong>Country Borders<\/strong> information, the <code>country_borders<\/code> table can be created and loaded by the following code in MySQL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-- Create table \"country_borders\"\nCREATE TABLE `country_borders`(\n\t`country_code` VARCHAR(2),\n\t`country_name` VARCHAR(100),\n\t`country_border_code` VARCHAR(2),\n\t`country_border_name` VARCHAR(100),\n\tPRIMARY KEY (`country_code`, `country_border_code`),\n\tINDEX `idx_country_code` (`country_code`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;\n\n-- Load data into table\nLOAD DATA LOCAL\nINFILE 'GEODATASOURCE-COUNTRY-BORDERS.CSV'\nINTO TABLE `country_borders`\nFIELDS TERMINATED BY ','\nENCLOSED BY '\"'\nLINES TERMINATED BY 'rn'\nIGNORE 1 LINES;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Licensing<\/h2>\n\n\n\n<p>The Country Borders data is licensed under <a href=\"https:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 International License<\/a>. It is free for personal or commercial use with attribution required by mentioning the use of this data as follows,<br><strong>This site or product includes Country Borders data available from <a href=\"https:\/\/www.geodatasource.com\">https:\/\/www.geodatasource.com<\/a>.<\/strong><\/p>\n\n\n\n<p>For more details about the<strong> Country Borders<\/strong> databases, you can visit <a href=\"https:\/\/www.geodatasource.com\/addon\/country-borders\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.geodatasource.com\/addon\/country-borders<\/a> to learn more about the information provided.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A border is a line either in real or artificial that splits up the geographical areas. Borders are the political [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"doc_category":[20],"doc_tag":[],"class_list":["post-674","docs","type-docs","status-publish","hentry","doc_category-general-topics"],"year_month":"2026-06","word_count":359,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Gary Chewter","author_nicename":"jianhong","author_url":"https:\/\/www.geodatasource.com\/resources\/author\/jianhong\/"},"doc_category_info":[{"term_name":"General Topics","term_url":"https:\/\/www.geodatasource.com\/resources\/categories\/general-topics\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is the Country Borders data |<\/title>\n<meta name=\"description\" content=\"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the Country Borders data |\" \/>\n<meta property=\"og:description\" content=\"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/geodatasource\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@_geodatasource\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/\",\"url\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/\",\"name\":\"What is the Country Borders data |\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/gds-april-img.png\",\"datePublished\":\"2022-04-21T00:00:00+00:00\",\"description\":\"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/gds-april-img.png\",\"contentUrl\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/gds-april-img.png\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/what-is-the-country-borders-data\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is the Country Borders data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#website\",\"url\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/\",\"name\":\"GeoDataSource Articles & Tutorials\",\"description\":\"Resources About GeoDataSource Services\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#organization\",\"name\":\"GeoDataSource.com\",\"url\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/logo-e1564122827936.png\",\"contentUrl\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/logo-e1564122827936.png\",\"width\":220,\"height\":27,\"caption\":\"GeoDataSource.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.geodatasource.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/geodatasource\\\/\",\"https:\\\/\\\/x.com\\\/_geodatasource\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the Country Borders data |","description":"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/","og_locale":"en_US","og_type":"article","og_title":"What is the Country Borders data |","og_description":"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.","og_url":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/","article_publisher":"https:\/\/www.facebook.com\/geodatasource\/","og_image":[{"url":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_site":"@_geodatasource","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/","url":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/","name":"What is the Country Borders data |","isPartOf":{"@id":"https:\/\/www.geodatasource.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/#primaryimage"},"image":{"@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/#primaryimage"},"thumbnailUrl":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png","datePublished":"2022-04-21T00:00:00+00:00","description":"This article shows the definition of What is Country Borders and the examples. Read about it to learn more.","breadcrumb":{"@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/#primaryimage","url":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png","contentUrl":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2022\/04\/gds-april-img.png","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.geodatasource.com\/resources\/tutorials\/what-is-the-country-borders-data\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.geodatasource.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"https:\/\/www.geodatasource.com\/resources\/tutorials\/"},{"@type":"ListItem","position":3,"name":"What is the Country Borders data"}]},{"@type":"WebSite","@id":"https:\/\/www.geodatasource.com\/resources\/#website","url":"https:\/\/www.geodatasource.com\/resources\/","name":"GeoDataSource Articles & Tutorials","description":"Resources About GeoDataSource Services","publisher":{"@id":"https:\/\/www.geodatasource.com\/resources\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.geodatasource.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.geodatasource.com\/resources\/#organization","name":"GeoDataSource.com","url":"https:\/\/www.geodatasource.com\/resources\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.geodatasource.com\/resources\/#\/schema\/logo\/image\/","url":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2019\/07\/logo-e1564122827936.png","contentUrl":"https:\/\/www.geodatasource.com\/resources\/wp-content\/uploads\/2019\/07\/logo-e1564122827936.png","width":220,"height":27,"caption":"GeoDataSource.com"},"image":{"@id":"https:\/\/www.geodatasource.com\/resources\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/geodatasource\/","https:\/\/x.com\/_geodatasource"]}]}},"_links":{"self":[{"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/docs\/674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":0,"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/docs\/674\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/media?parent=674"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/doc_category?post=674"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.geodatasource.com\/resources\/wp-json\/wp\/v2\/doc_tag?post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}