Get specified spatial layer from OxCOVID19 Database

get_layer(con, layer = "administrative_division", ccode, adm)

Arguments

con

Connection to OxCOVID19 Database. This can be specified using the connect_oxcovid19() function.

layer

Name of spatial layer available in OxCOVID19 Database. Currently, only administrative_division is a spatial layer.

ccode

Three character ISO country code for required country layers.

adm

Numeric value for administrative level layer required. Possible values are 0 for whole country, 1 for administrative level 1, 2 for administrative level 2 and 3 for administrative level 3. Default is 0 for country borders.

Value

An object of sf class of the specified spatial layer

Author

Ernest Guevarra

Examples

con <- connect_oxcovid19() get_layer(con = con, ccode = "CHN", adm = 1)
#> Simple feature collection with 31 features and 14 fields #> geometry type: GEOMETRY #> dimension: XY #> bbox: xmin: 73.5577 ymin: 18.15931 xmax: 134.7716 ymax: 53.56004 #> geographic CRS: WGS 84 #> First 10 features: #> country countrycode countrycode_alpha2 adm_level adm_area_1 adm_area_1_code #> 1 China CHN CN 1 Guizhou CHN.8_1 #> 2 China CHN CN 1 Anhui CHN.1_1 #> 3 China CHN CN 1 Beijing CHN.2_1 #> 4 China CHN CN 1 Chongqing CHN.3_1 #> 5 China CHN CN 1 Fujian CHN.4_1 #> 6 China CHN CN 1 Gansu CHN.5_1 #> 7 China CHN CN 1 Guangdong CHN.6_1 #> 8 China CHN CN 1 Guangxi CHN.7_1 #> 9 China CHN CN 1 Hainan CHN.9_1 #> 10 China CHN CN 1 Hebei CHN.10_1 #> adm_area_2 adm_area_2_code adm_area_3 adm_area_3_code gid latitude #> 1 <NA> <NA> <NA> <NA> CHN.8_1 26.81518 #> 2 <NA> <NA> <NA> <NA> CHN.1_1 31.82579 #> 3 <NA> <NA> <NA> <NA> CHN.2_1 40.18491 #> 4 <NA> <NA> <NA> <NA> CHN.3_1 30.05865 #> 5 <NA> <NA> <NA> <NA> CHN.4_1 26.08106 #> 6 <NA> <NA> <NA> <NA> CHN.5_1 37.82079 #> 7 <NA> <NA> <NA> <NA> CHN.6_1 23.33520 #> 8 <NA> <NA> <NA> <NA> CHN.7_1 23.82701 #> 9 <NA> <NA> <NA> <NA> CHN.9_1 19.19553 #> 10 <NA> <NA> <NA> <NA> CHN.10_1 39.54574 #> longitude #> 1 106.8741 #> 2 117.2262 #> 3 116.4107 #> 4 107.8748 #> 5 117.9899 #> 6 100.9339 #> 7 113.4153 #> 8 108.7866 #> 9 109.7458 #> 10 116.1301 #> properties #> 1 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.8_1", "HASC_1": "CN.GZ", "NAME_0": "China", "NAME_1": "Guizhou", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "貴州|贵州", "VARNAME_1": "Gùizhōu"} #> 2 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.1_1", "HASC_1": "CN.AH", "NAME_0": "China", "NAME_1": "Anhui", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "安徽|安徽", "VARNAME_1": "Ānhuī"} #> 3 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.2_1", "HASC_1": "CN.BJ", "NAME_0": "China", "NAME_1": "Beijing", "TYPE_1": "Zhíxiáshì", "ENGTYPE_1": "Municipality", "NL_NAME_1": "北京|北京", "VARNAME_1": "Běijīng"} #> 4 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.3_1", "HASC_1": "CN.CQ", "NAME_0": "China", "NAME_1": "Chongqing", "TYPE_1": "Zhíxiáshì", "ENGTYPE_1": "Municipality", "NL_NAME_1": "重慶|重庆", "VARNAME_1": "Chóngqìng"} #> 5 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.4_1", "HASC_1": "CN.FJ", "NAME_0": "China", "NAME_1": "Fujian", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "福建", "VARNAME_1": "Fújiàn"} #> 6 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.5_1", "HASC_1": "CN.GS", "NAME_0": "China", "NAME_1": "Gansu", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "甘肅|甘肃", "VARNAME_1": "Gānsù"} #> 7 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.6_1", "HASC_1": "CN.GD", "NAME_0": "China", "NAME_1": "Guangdong", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "廣東|广东", "VARNAME_1": "Guǎngdōng"} #> 8 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.7_1", "HASC_1": "CN.GX", "NAME_0": "China", "NAME_1": "Guangxi", "TYPE_1": "Zìzhìqu", "ENGTYPE_1": "Autonomous Region", "NL_NAME_1": "廣西壯族自治區|广西壮族自治区", "VARNAME_1": "Guǎngxī Zhuàngzú"} #> 9 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.9_1", "HASC_1": "CN.HA", "NAME_0": "China", "NAME_1": "Hainan", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "海南", "VARNAME_1": "Hǎinán"} #> 10 {"CC_1": null, "GID_0": "CHN", "GID_1": "CHN.10_1", "HASC_1": "CN.HB", "NAME_0": "China", "NAME_1": "Hebei", "TYPE_1": "Shěng", "ENGTYPE_1": "Province", "NL_NAME_1": "河北", "VARNAME_1": "Héběi"} #> geometry #> 1 MULTIPOLYGON (((109.5513 26... #> 2 POLYGON ((116.5815 30.04759... #> 3 POLYGON ((116.2377 39.51794... #> 4 POLYGON ((109.232 28.8789, ... #> 5 MULTIPOLYGON (((120.7168 26... #> 6 POLYGON ((101.7742 33.54804... #> 7 MULTIPOLYGON (((109.7414 21... #> 8 MULTIPOLYGON (((108.4797 21... #> 9 MULTIPOLYGON (((109.5334 19... #> 10 MULTIPOLYGON (((115.1205 36...