get_kaz_rayons_map: Get Rayons Oblasts & Cities of Oblast Significance of...

View source: R/get_kaz_map.R

get_kaz_rayons_mapR Documentation

Get Rayons Oblasts & Cities of Oblast Significance of Kazakhstan as sf polygons

Description

Returns Geographical features of Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan - Map of All Administrative units level 2 (the district units of principal units) as polygons by specified codes or names or all of them in 2024 (default) or 2018 year.

Usage

get_kaz_rayons_map(
                   KATO = NULL,        # Number
                   ADM1_EN = NULL,     # Character
                   ADM1_KK = NULL,     # Character
                   ADM1_RU = NULL,     # Character
                   ADM1_PCODE = NULL,  # Character
                   ADM2_EN = NULL,     # Character
                   ADM2_KK = NULL,     # Character
                   ADM2_RU = NULL,     # Character
                   ADM2_PCODE = NULL,  # Character
                   ISO_3166_2 = NULL,  # Character
                   crs = "+proj=lcc +lon_0=67 +lat_1=45 +lat_2=51 +ellps=krass",
                   Year = 2024L        # Integer
                   )

Arguments

KATO

A vector of Codes of Classifier of Administrative Territorial Objects (rus. KATO) for the required Oblasts & Cities of Republican Significance of Kazakhstan or NULL to get all of them.

ADM1_EN

A vector of Names of Administrative units level 1 on English for the required Oblasts & Cities of Republican Significance of Kazakhstan or NULL to get all of them.

ADM1_KK

A vector of Names of Administrative units level 1 on Kazakh (Cyrillic) characters for the required Oblasts & Cities of Republican Significance of Kazakhstan or NULL to get all of them.

ADM1_RU

A vector of Names of Administrative units level 1 on Russian (Cyrillic) characters for the required Oblasts & Cities of Republican Significance of Kazakhstan or NULL to get all of them.

ADM1_PCODE

A vector of modified Codes of Classifier of Administrative Territorial Objects (rus. KATO) for the required Oblasts & Cities of Republican Significance of Kazakhstan with 'KZ-' prefix or NULL to get all of them.

ADM2_EN

A vector of Names of Administrative units level 2 on English for the required Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan or NULL to get all of them.

ADM2_KK

A vector of Names of Administrative units level 2 on Kazakh (Cyrillic) characters for the required Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan or NULL to get all of them.

ADM2_RU

A vector of Names of Administrative units level 2 on Russian (Cyrillic) characters for the required Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan or NULL to get all of them.

ADM2_PCODE

A vector of modified Codes of Classifier of Administrative Territorial Objects (rus. KATO) for the required Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan with 'KZ-' prefix or NULL to get all of them.

ISO_3166_2

A vector of Codes for the principal subdivisions coded in ISO 3166-2 or NULL to get all of them.

crs

A value of Coordinate Reference System as EPSG (SRID) number (for example, 2502) or proj4string from the PROJ.4 library (for example, "+proj=longlat +datum=WGS84" as a projection specifier or "+init=epsg:4326" as EPSG number) or NULL to get projection for A Lambert Conformal Conic (LCC) with Krasovsky 1940 ellipsoid. See Details.

Year

An integer of Year for Administrative-Territorial divisions of the Country: 2018 or 2024 (default).

Details

When filter Geographical features you can use some names of Oblasts & Cities of Republican Significance, Rayons of Oblasts & Cities of Oblast Significance in English, Kazakh or Russian or National codes (ADM1_PCODE corresponding to level 1, ADM2_PCODE or KATO corresponding to level 2) or ISO International codes (ISO 3166-2 corresponding to level 1) (see kaz_adm2_sf).

Nur-Sultan, Almaty and Shymkent are considered as a set of regions on this dataset.

Baykonyr (a city near the World's First Spaceport) are not considered on this dataset.

Simultaneous use of several types of geographic features codes or names in different languages is not allowed.

For use non-latin characters in filters you need run cat(stringi::stri_escape_unicode(x)) code R, for example, cat(stringi::stri_escape_unicode("\u0428\u044B\u043C\u043A\u0435\u043D\u0442 (\u049B\u0430\u043B\u0430)")) that is "Шымкент (қала)" or "Shymkent (city)" in Kazakh language. See stringi::stri_escape_unicode for details.

The Default Projection uses A Lambert Conformal Conic (LCC) with Krasovsky 1940 ellipsoid and First standard parallel - 45 N, Second standard parallel - 51 N, Longitude of projection center - 67 E, Latitude of projection center - 48 N.

Value

A sf object with the requested geographic geometries.

Author(s)

Alexander Rodionov a.rodionoff@gmail.com, ORCID = "0000-0003-2028-5421".

See Also

You can upload dataset kaz_adm2_sf for Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan directly, but you must manually filter the Geographic Features you require and set the suitable Cartographic Projection.

For maps of Rayons of Oblast & City of Oblast Significance in 2024 Version please use function get_kaz_rayons_map⁠()⁠ or dataset kaz_adm2_sf.

For maps of Rayons of Oblast & City of Oblast Significance in 2018 Version please use function get_kaz_rayons_map(Year = 2018L) or dataset kaz_adm2_2018_sf.

package vignette or vignette("making_maps", package = "geokz")

Other general polygon functions: get_kaz_oblasts_map()

Examples

kaz <- get_kaz_rayons_map()

plot(
  kaz["ADM1_EN"],
  main = "Rayons of Oblasts & Cities of Oblast Significance of Kazakhstan"
)


if (requireNamespace("dplyr", "tmap", quietly = TRUE)) {

library(dplyr)
library(tmap)

# Northern Regions

Northern_Region <-
  c(
    "Akmola",
    "Kostanay",
    "Pavlodar",
    "North Kazakhstan",
    "Nur-Sultan (city)"
  )

tmap::tm_shape(shp = get_kaz_oblasts_map(ADM1_EN = Northern_Region)) +
  tmap::tm_fill(
    "ADM1_EN",
    title = "Administrative \nunits level 1"
    ) +
tmap::tm_shape(
  shp = get_kaz_rayons_map(ADM1_EN = Northern_Region),
  is.master = TRUE
  ) +
  tmap::tm_polygons(
    "MAP_COLORS",
    palette = "Greys",
    alpha = 0.25
    ) +
tmap::tm_shape(get_kaz_oblasts_map()) +
  tmap::tm_borders(lwd = 2) +
  tmap::tm_text("ADM1_KK", size = 1.5, shadow = TRUE) +
  tmap::tm_format(
    format  = "World",
    title    = "Northern Region of Kazakhstan",
    bg.color = "white"
    )

# Simultaneous use of several types of International & National codes or
# names in different languages **is allowed** with binding geographic features

# Torgay Oblast is disbanded Region of the Kazakh Soviet Socialist Republic from 1970 to 1988
# and of independent Kazakhstan and from 1990 to 1997 <https://en.wikipedia.org/wiki/Torgay_Region>.

Torgay_Region <-
  get_kaz_rayons_map(ADM2_EN = c(
    "Esil",
    "Zhaksy",
    "Zharkain")) |>
  dplyr::filter(ADM1_EN == "Akmola") |>  # There are three rayons named Esil by Esil (Ishim) river
  dplyr::bind_rows(
    get_kaz_rayons_map(ADM2_PCODE = c(
      "KZ391600",                         # Arkalyk city was a Center of Torgay Oblast
      "KZ393400",                         # Amangeldi rayon
      "KZ394200")                         # Zhangeldi rayons
      )
  )

center_sf <-
  data.frame(
    NAME = c("Arkalyk"),
    BRANCH = c("The Center"),
    LINK = c("https://en.wikipedia.org/wiki/Arkalyk"),
    LAT = c(50.24861),
    LON = c(66.91139)
  ) |>
  sf::st_as_sf(
    coords = c("LON", "LAT"), # columns with geometry by x - "LON" and y - "LAT"
    crs = "+proj=longlat +datum=WGS84"
  )

to_bb <-
  Torgay_Region |>
  sf::st_bbox() |>
  sf::st_as_sfc() |>
  sf::st_buffer(dist = 50000)

tmap::tm_shape(Torgay_Region) +
  tmap::tm_polygons(
    col = "ADM2_EN",
    border.col = "grey",
    title = "Administrative \nunits level 2",
    labels = Torgay_Region$ADM2_KK
  ) +
  tmap::tm_text("ADM2_KK", col = "gray10", size = 0.9, shadow = TRUE) +
tmap::tm_shape(
  shp  = get_kaz_oblasts_map(),
  bbox = to_bb
  ) +
  tmap::tm_borders(
    col = "red",
    lwd = 4
  ) +
  tmap::tm_text("ADM1_KK", col = "gray10", size = 1.2, shadow = TRUE) +
tmap::tm_shape(center_sf) +
  tmap::tm_dots(size = 1) +
tmap::tm_graticules(lines = FALSE) +
  tmap::tm_format(format = 'World') +
  tmap::tm_layout(
    main.title = "Disbanded Torgay Oblast (1970-1988, 1990-1997)",
    main.title.size = 0.9,
    legend.position = c("left", "top")
  ) +
  tmap::tm_credits('Source: package {geokz}', position = c('right', 'bottom'), size = 1.2)

}    # The end for {dplyr} & {tmap} package

## Not run: 
  get_kaz_rayons_map("a")
  get_kaz_rayons_map(crs = "a")

## End(Not run)


arodionoff/geokz documentation built on July 1, 2024, 9:02 p.m.