Google Earth Engine(GEE) ——geoBoundaries全球政治行政边界数据库

自2017年以来,由威廉和玛丽地理实验室制作和维护的geoBoundaries全球政治行政边界数据库是世界上每个国家的边界(即州、县)的在线、开放许可资源。我们目前共追踪了199个实体,包括所有195个联合国会员国、格陵兰岛、台湾、纽埃和科索沃。所有的边界都可以查看或下载通用的文件格式,包括shapefiles;使用的唯一要求是确认。关于geoBoundaries的最新信息可以在www.geoboundaries.org。

所有的边界类型都已被摄取,包括以下已被摄取的管理水平从0-4不等。

HPSCU - 高精度单一国家非标准化。首要的geoBoundaries版本,代表世界上每个国家的最高精度文件。这些文件没有进行标准化处理,因此(例如)在边界有争议的情况下,两个国家可能会重叠。

HPSCGS - 全球标准化的高精度单一国家。geoBoundaries高精度数据的一个版本,已被剪切到美国国务院的边界文件,确保数据集中没有有争议的边界或重叠。这种全球标准化的产品在国家之间可能有差距。如果你需要一个没有缺口的产品,我们推荐我们的简化全球产品。

SSCU - 简化的单一国家非标准化。为世界上每个国家提供的每个文件的简化版本。这些文件没有进行标准化处理,因此(例如)在边界有争议的情况下,两个国家可能会有重叠。

SSCGS - 简化的单一国家全球标准化。geoBoundaries简化数据的一个版本,已被剪成美国国务院的边界文件,确保数据集中没有有争议的边界或重叠。这种全球标准化的产品在国家之间可能有差距。

CGAZ - 全球综合行政区。是SSCGS ADM0、ADM1和ADM2的全球合成,边界之间有空白。也可在更高的简化水平上提供。

Feature CollectionAdmin Levels
HPSCUADM0,ADM1,ADM2,ADM3,ADM4
HPSCGSADM0,ADM1,ADM2,ADM3,ADM4
SSCUADM0,ADM1,ADM2,ADM3,ADM4
SSCGSADM0,ADM1,ADM2,ADM3,ADM4
CGAZADM0,ADM1,ADM2

代码:

var CGAZ_ADM0 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM0');
var CGAZ_ADM1 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM1');
var CGAZ_ADM2 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM2');
var HPSCGS_ADM0 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM0');
var HPSCGS_ADM1 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM1');
var HPSCGS_ADM2 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM2');
var HPSCGS_ADM3 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM3');
var HPSCGS_ADM4 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM4');
var HPSCU_ADM0 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCU-ADM0');
var HPSCU_ADM1 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCU-ADM1');
var HPSCU_ADM2 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCU-ADM2');
var HPSCU_ADM3 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCU-ADM3');
var HPSCU_ADM4 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/HPSCU-ADM4');
var SSCGS_ADM0 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCGS-ADM0');
var SSCGS_ADM1 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCGS-ADM1');
var SSCGS_ADM2 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCGS-ADM2');
var SSCGS_ADM3 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCGS-ADM3');
var SSCGS_ADM4 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCGS-ADM4');
var SSCU_ADM0 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCU-ADM0');
var SSCU_ADM1 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCU-ADM1');
var SSCU_ADM2 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCU-ADM2');
var SSCU_ADM3 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCU-ADM3');
var SSCU_ADM4 = ee.FeatureCollection('projects/earthengine-legacy/assets/projects/sat-io/open-datasets/geoboundaries/SSCU-ADM4');

 引用:

Runfola D, Anderson A, Baier H, Crittenden M, Dowker E, Fuhrig S, et al. (2020) geoBoundaries: A global database of political administrative boundaries. PLoS ONE 15(4): e0231866. https://doi.org/10.1371/journal.pone.0231866 

GEE的数据预处理
为了使数据集更容易使用,我们使用API下载了数据集,然后将一个文件夹中的所有特征合并成与不同的边界类型和管理水平有关的单一集合。由于下载或上传到GEE的问题,可能会有一些遗漏的部分,但我们已经注意到将这些工作降到最低。

License

Individual data files in the geoBoundaries database are governed by the license or licenses identified within the metadata for each respective boundary and are all variants of partially or completely open licenses. All referenced licenses can be read in their entirety here. Computer code and derivative works generated by the geoBoundaries project are released under the Attribution 4.0 International (CC BY 4.0) license.

Produced and maintained by the William & Mary geoLab since 2017

Processed secondary/formatted & Curated by: Samapriya Roy

 代码案例:

/**************Code Attribution: Code Provided by  www.spatialthoughts.com*****/

// Drill-down (Cascading Forms) for Selecting Administrative Boundaries
// This script shows how to build hierarchical selection using UI Widgets

// Using GeoBoundries admin boundaries
var admin0 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM0");
var admin1 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM1");
var admin2 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/CGAZ_ADM2");


// Set-up the panel
var mainPanel = ui.Panel();
mainPanel.style().set({
  width: '300px',
});
ui.root.insert(0,mainPanel);

var title = ui.Label('Drill-down Selector');
title.style().set({
  'position':  'top-center',
  'fontSize': '24px'
  });
mainPanel.add(title)

// Create a panel to hold the drop-down boxes
var dropdownPanel = ui.Panel();

// Create a panel to hold the result
var resultPanel = ui.Panel();

// Define 3 dropdowns for admin0, admin1 and admin2 names

// Keep them disbled. We will add items later
var admin0Select = ui.Select({
    placeholder: 'please wait..',
  }).setDisabled(true)
  
var admin1Select = ui.Select({
    placeholder: 'select admin0 unit first',
  }).setDisabled(true)
  
var admin2Select = ui.Select({
  placeholder: 'select admin1 unit first',
}).setDisabled(true)

dropdownPanel.add(admin0Select)
dropdownPanel.add(admin1Select)
dropdownPanel.add(admin2Select)

mainPanel.add(dropdownPanel)
mainPanel.add(resultPanel)

// *************************
// Define callback functions
// *************************

// We need to do this first since the functions need to
// be defined before they are used.

// Define the onChange() function for admin0Select
var admin0Selected = function(admin0Selection) {
  resultPanel.clear()
  Map.clear()
  admin1Select.items().reset()
  admin2Select.items().reset()
  admin1Select.setPlaceholder('please wait..')
  admin2Select.setPlaceholder('Select a admin1 unit first..')

  // Now we have admin0 values, fetch admin1 values for that country
  
  var selectedAdmin0 = admin0.filter(ee.Filter.eq('shapeName', admin0Selection));
  var shapeID = ee.Feature(selectedAdmin0.first()).get('shapeID');
  var selectedAdmin1 = admin1.filter(ee.Filter.eq('ADM0_shape', shapeID));

  var admin1Names = selectedAdmin1
    .aggregate_array('shapeName')
    .sort()

  // Use evaluate() to not block the UI
  admin1Names.evaluate(function(items){
    admin1Select.setPlaceholder('select admin1 unit')
    admin1Select.items().reset(items)
    // Now that we have items, enable the menu
    admin1Select.setDisabled(false)
  })
}

// Define the onChange() function for admin1Select
var admin1Selected = function(admin1Selection) {
  resultPanel.clear()
  Map.clear()
  admin2Select.setPlaceholder('please wait..')

  var selectedAdmin1 = admin1.filter(ee.Filter.eq('shapeName', admin1Selection));
  
  var shapeID = ee.Feature(selectedAdmin1.first()).get('shapeID');
  var selectedAdmin2 = admin2.filter(ee.Filter.eq('ADM1_shape', shapeID));

  var admin2Names = selectedAdmin2
    .aggregate_array('shapeName')
    .sort()

  
  admin2Names.evaluate(function(items){
    if (items.length == 0) {
      items = ['No Admin2 Units']
      admin2Select.items().reset(items)
    }
    else {
      admin2Select.items().reset(items)  
    }
    admin2Select.setPlaceholder('select admin2 unit')
    admin2Select.setDisabled(false)
  })
}

// Define the onChange() function for admin2Select
var admin2Selected = function(admin1Selection) {
  resultPanel.clear()
  Map.clear()
  var admin0Value = admin0Select.getValue()
  var admin1Value = admin1Select.getValue()
  var admin2Value = admin2Select.getValue()
  
  var selectedAdmin1 = admin1.filter(ee.Filter.eq('shapeName', admin1Value));
  var shapeGroup = ee.Feature(selectedAdmin1.first()).get('shapeGroup');
  // Some regions do not have admin2 values
  // We are on client-side, so using if/else is ok
  if (admin2Value == 'No Admin2 Units') {
      var result = admin1Value + ',' + admin0Value
      var filtered = admin1
        .filter(ee.Filter.eq('shapeName', admin1Value))
        .filter(ee.Filter.eq('shapeGroup', shapeGroup))
  }
  else {
      var result = admin2Value + ',' + admin1Value + ',' + admin0Value
      var filtered = admin2
        .filter(ee.Filter.eq('shapeName', admin2Value))
        .filter(ee.Filter.eq('shapeGroup', shapeGroup))
        .filter(ee.Filter.intersects('.geo', selectedAdmin1.geometry()));

  }
  var label = ui.Label('You selected: ' + result)
  resultPanel.add(label)
  Map.centerObject(filtered)
  Map.addLayer(filtered, {color: 'blue'}, result)
}

// Register the callback functions
admin0Select.onChange(admin0Selected)
admin1Select.onChange(admin1Selected)
admin2Select.onChange(admin2Selected)

// ******************
// Populate the items
// ******************

// Get all country names and sort them
var admin0Names = admin0.aggregate_array('shapeName').sort().distinct()
// Fetch the value using evaluate() to not block the UI
admin0Names.evaluate(function(items){
  admin0Select.items().reset(items)
  // Now that we have items, enable the menu
  admin0Select.setDisabled(false)
  // Change placeholder
  admin0Select.setPlaceholder('Select admin0 unit')

})

 

全球行政区划shapefile数据,包含全球行政区划数据。NAME GMI_CNTRY REGION Afghanistan AFG Asia Albania ALB Europe Algeria DZA NorthAfrica Andorra AND Europe Angola AGO Sub Saharan Africa Antarctica ATA Antarctica Antigua and Barbuda ATG Caribbean Argentina ARG Latin America Armenia ARM Asia Australia AUS Australia Austria AUT Europe Azerbaijan AZE Asia Bahamas, The BHS Caribbean Bahrain BHR Asia Bangladesh BGD Asia Barbados BRB Caribbean Belgium BEL Europe Belize BLZ Latin America Benin BEN Sub Saharan Africa Bermuda BMU North America Bhutan BTN Asia Bolivia BOL Latin America Bosnia and Herzegovina BIH Europe Botswana BWA Sub Saharan Africa Brazil BRA Latin America Brunei BRN Asia Bulgaria BGR Europe Burkina Faso BFA Sub Saharan Africa Burundi BDI Sub Saharan Africa Byelarus BLR Europe Cambodia KHM Asia Cameroon CMR Sub Saharan Africa Canada CAN North America Cape Verde CPV Sub Saharan Africa Central African Republic CAF Sub Saharan Africa Chad TCD Sub Saharan Africa Chile CHL Latin America China CHN Asia Colombia COL Latin America Comoros COM Sub Saharan Africa Congo COG Sub Saharan Africa Costa Rica CRI Latin America Croatia HRV Europe Cuba CUB Caribbean Cyprus CYP Asia Czech Republic CZE Europe Denmark DNK Europe Djibouti DJI Sub Saharan Africa Dominica DMA Caribbean Dominican Republic DOM Caribbean Ecuador ECU Latin America Egypt EGY NorthAfrica El Salvador SLV Latin America Equatorial Guinea GNQ Sub Saharan Africa Eritrea ERI Sub Saharan Africa Estonia EST Europe Ethiopia ETH Sub Saharan Africa Falkland Islands (Islas Malvinas) FLK Latin America Faroe Islands FRO Europe Fiji FJI Asia Finland FIN Europe France FRA Europe French Guiana GUF Latin America French Polynesia PYF Pacific Gabon GAB Sub Saharan Africa Gambia, The GMB Sub Saharan Africa Gaza Strip ISR Asia Georgia GEO Asia Germany DEU Europe Ghana GHA Sub Saharan Africa Greece GRC Europe Greenland GRL North America Grenada GRD Caribbean Guadeloupe GLP Caribbean Guatemala GTM Latin America Guinea GIN Sub Saharan Africa Guinea-Bissau GNB Sub Saharan Africa Guyana GUY Latin America Haiti HTI Caribbean Honduras HND Latin America Hungary HUN Europe Iceland ISL Europe India IND Asia Indonesia IDN Asia Iran IRN Asia Iraq IRQ Asia Iraq-Saudi Arabia Neutral Zone Asia Ireland IRL Europe Isle of Man XIM Europe Israel ISR Asia Italy ITA Europe Ivory Coast CIV Sub Saharan Africa Jamaica JAM Caribbean Jan Mayen SJM Europe Japan JPN Asia Jordan JOR Asia Kazakhstan KAZ Asia Kenya KEN Sub Saharan Africa Kerguelen Antarctica Kiribati KIR Asia Korea, Peoples Republic of PRK Asia Korea, Republic of KOR Asia Kuwait KWT Asia Kyrgyzstan KGZ Asia Laos LAO Asia Latvia LVA Europe Lebanon LBN Asia Lesotho LSO Sub Saharan Africa Liberia LBR Sub Saharan Africa Libya LBY NorthAfrica Liechtenstein LIE Europe Lithuania LTU Europe Luxembourg LUX Europe Macedonia MKD Europe Madagascar MDG Sub Saharan Africa Malawi MWI Sub Saharan Africa Malaysia MYS Asia Maldives MDV Pacific Mali MLI Sub Saharan Africa Malta MLT Pacific Martinique MTQ Caribbean Mauritania MRT Sub Saharan Africa Mauritius MUS Sub Saharan Africa Mexico MEX Latin America Moldova MDA Europe Monaco MCO Europe Mongolia MNG Asia Morocco MAR NorthAfrica Mozambique MOZ Sub Saharan Africa Myanmar (Burma) MMR Asia Namibia NAM Sub Saharan Africa Nepal NPL Asia Netherlands NLD Europe New Caledonia NCL Asia New Zealand NZL Australia Nicaragua NIC Latin America Niger NER Sub Saharan Africa Nigeria NGA Sub Saharan Africa Northern Mariana Islands MNP Pacific Norway NOR Europe Oman OMN Asia Pakistan PAK Asia Panama PAN Latin America Papua New Guinea PNG Asia Paraguay PRY Latin America Peru PER Latin America Philippines PHL Asia Poland POL Europe Portugal PRT Europe Puerto Rico PRI Caribbean Qatar QAT Asia Reunion REU Sub Saharan Africa Romania ROM Europe Russia RUS Europe Rwanda RWA Sub Saharan Africa San Marino SMR Europe Sao Tome and Principe STP Sub Saharan Africa Saudi Arabia SAU Asia Senegal SEN Sub Saharan Africa Seychelles SYC Sub Saharan Africa Sierra Leone SLE Sub Saharan Africa Singapore SGP Pacific Slovakia SVK Europe Slovenia SVN Europe Solomon Islands SLB Asia Somalia SOM Sub Saharan Africa South Africa ZAF Sub Saharan Africa Spain ESP Europe Sri Lanka LKA Asia St. Christopher-Nevis Caribbean St. Lucia LCA Caribbean St. Vincent and the Grenadines VCT Caribbean Sudan SDN Sub Saharan Africa Suriname SUR Latin America Svalbard SJM Europe Swaziland SWZ Sub Saharan Africa Sweden SWE Europe Switzerland CHE Europe Syria SYR Asia Tajikistan TJK Asia Tanzania, United Republic of TZA Sub Saharan Africa Thailand THA Asia Togo TGO Sub Saharan Africa Tonga TON Pacific Trinidad and Tobago TTO Caribbean Tunisia TUN NorthAfrica Turkey TUR Asia Turkmenistan TKM Asia Turks and Caicos Islands TCA Caribbean Uganda UGA Sub Saharan Africa Ukraine UKR Europe United Arab Emirates ARE Asia United Kingdom GBR Europe United States USA North America Uruguay URY Latin America Uzbekistan UZB Asia Vanuatu VUT Asia Venezuela VEN Latin America Vietnam VNM Asia Western Sahara ESH NorthAfrica Western Samoa WSM Pacific Yemen YEM Asia Yugoslavia YUG Europe Zaire ZAR Sub Saharan Africa Zambia ZMB Sub Saharan Africa Zimbabwe ZWE Sub Saharan Africa
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此星光明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值