| Title: | Geographic Boundaries of Mexico from INEGI and INE |
|---|---|
| Description: | Geographic boundaries of Mexico (states, municipalities, localities, AGEB, blocks and electoral sections) from INEGI 2019 and INE 2020, and functions to extract the AGEB, blocks and electoral sections of a locality. |
| Authors: | Felipe Antonio Dzul Manzanilla [aut, cre] (ORCID: <https://orcid.org/0000-0002-2085-9141>), Fabián Correa-Morales [aut] (ORCID: <https://orcid.org/0000-0002-6193-1242>), Emmanuel Morales García [aut] (ORCID: <https://orcid.org/0000-0002-6837-9227>), Cecilia Cruz López [aut] (ORCID: <https://orcid.org/0000-0002-9156-5669>), Héctor Gómez-Dantés [aut] (ORCID: <https://orcid.org/0000-0002-2025-3641>) |
| Maintainer: | Felipe Antonio Dzul Manzanilla <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-11-22 14:09:59 UTC |
| Source: | https://github.com/fdzul/rgeomex |
A spatial dataset containing of polygon data of AGEBs from México
AGEB_inegi_2019_aAGEB_inegi_2019_a
A sf object with 80202 rows and 10 variables:
the ids.
the string key. The key included the CVE_ENT, CVE_MUN, CVE_LOC and CVE_AGEB
is the string key for each state.
is the string key to the Municipality.
is string the key of locality.
is the string key of AGEB.
is a binary variable with two values, Urbana and Rural. The dataset is inly AGEB Urban
is the length of polygon
simple feature.
...
AGEB (Areas GeoEstadisticas Basicas) is stand for basic geostatistical areas. This datasets were published in september 2019.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
A spatial dataset containing of polygon data of AGEBs from México
AGEB_inegi_2019_bAGEB_inegi_2019_b
A sf object with 80202 rows and 10 variables:
the ids.
the string key. The key included the CVE_ENT, CVE_MUN, CVE_LOC and CVE_AGEB
is the string key for each state.
is the string key to the Municipality.
is string the key of locality.
is the string key of AGEB.
is a binary variable with two values, Urbana and Rural. The dataset is inly AGEB Urban
is the length of polygon
simple feature.
...
AGEB (Areas GeoEstadisticas Basicas) is stand for basic geostatistical areas. This datasets were published in september 2019.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
Polygons of AGEEs from México of the National Institute of Geography and Statistics 2019 A spatial dataset containing of polygon data of AGEE from México
AGEE_inegi19_mxAGEE_inegi19_mx
A sf object with 32 rows and 4 variables:
the numeric key. The key included the CVE_ENT.
is the numeric key for each state.
is a string value. Its the name of state.
simple feature.
...
AGEE (Areas GeoEstadisticas Estatales) is stand for State Geostatistical Areas. This datasets were published in september 2019.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
Polygons of AGEMs from México of the National Institute of Geography and Statistics 2019 A spatial dataset containing of polygon data of AGEM from México
AGEM_inegi19_mxAGEM_inegi19_mx
A sf object with 2465 rows and 5 variables:
the numeric key. The key included the CVE_ENT and the CVE_MUN.
is the numeric key for each state.
is the string key to the Municipality.
is a string value. Its the name of municipality.
simple feature.
...
AGEM (Areas GeoEstadisticas Municipales) is stand for Municipality Geostatistical Areas. This datasets were update 2025.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
Polygons of AGEMs from México of the National Institute of Geography and Statistics 2025 A spatial dataset containing of polygon data of AGEM from México
AGEM_inegi25_mxAGEM_inegi25_mx
A sf object with 2478 rows and 5 variables:
the numeric key. The key included the CVE_ENT and the CVE_MUN.
is the numeric key for each state.
is the string key to the Municipality.
is a string value. Its the name of municipality.
simple feature.
...
AGEM (Areas GeoEstadisticas Municipales) is stand for Municipality Geostatistical Areas.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
A spatial dataset containing of polygon data of blocks from Mexico
blocks_ine20_mx_ablocks_ine20_mx_a
A sf object with 2278337 rows and 19 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of locality
is the numeric key of blocks
simple feature.
...
This datasets were published in october 2020.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
A spatial dataset containing of polygon data of blocks from México
blocks_ine20_mx_bblocks_ine20_mx_b
A sf object with 2278337 rows and 19 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of locality
is the numeric key of blocks
simple feature.
...
This datasets were published in october 2020.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
A spatial dataset containing of polygon data of blocks from México
blocks_ine20_mx_cblocks_ine20_mx_c
A sf object with 2278337 rows and 19 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of locality
is the numeric key of blocks
simple feature.
...
This datasets were published in october 2020.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
Blocks centroids from México of the National Electoral Institute 2020 A dataset containing of centroid data of blocks from México
blocks_ine20_mx_centroidblocks_ine20_mx_centroid
A dataframe with 1556070 rows and 4 variables:
the numeric key state
is the numeric key for each block centroid.The key included the key of state, municipality, locality, sector and blocks.
is the longitude
is the latitude
...
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
A spatial dataset containing of polygon data of blocks from México
blocks_ine20_mx_dblocks_ine20_mx_d
A sf object with 2278337 rows and 19 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of locality
is the numeric key of blocks
simple feature.
...
This datasets were published in october 2020.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
A spatial dataset containing of polygon data of blocks from México
blocks_ine20_mx_eblocks_ine20_mx_e
A sf object with 2278337 rows and 19 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of locality
is the numeric key of blocks
simple feature.
...
This datasets were published in october 2020.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
Extracts the urban AGEB (INEGI 2019) that intersect the boundary of one or several localities.
extract_ageb(locality, cve_edo)extract_ageb(locality, cve_edo)
locality |
name of the locality (INEGI 2019), or a vector of names
for several localities, e.g. a metropolitan area. The most similar name
is used, so accents and capital letters do not matter. For Mexico City
( |
cve_edo |
INEGI key of the state, from |
a list with two sf objects: locality (the boundary of the
localities) and ageb (its AGEB).
Felipe Antonio Dzul Manzanilla [email protected].
x <- extract_ageb(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$ageb)) # several localities: metropolitan area of Guadalajara gdl <- extract_ageb(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))x <- extract_ageb(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$ageb)) # several localities: metropolitan area of Guadalajara gdl <- extract_ageb(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))
Extracts the blocks (manzanas, INE 2020) that intersect the boundary of one or several localities.
extract_blocks(locality, cve_edo)extract_blocks(locality, cve_edo)
locality |
name of the locality (INEGI 2019), or a vector of names
for several localities, e.g. a metropolitan area. The most similar name
is used, so accents and capital letters do not matter. For Mexico City
( |
cve_edo |
INEGI key of the state, from |
a list with two sf objects: locality (the boundary of the
localities) and block (its blocks).
Felipe Antonio Dzul Manzanilla [email protected].
x <- extract_blocks(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$block)) # several localities: metropolitan area of Guadalajara gdl <- extract_blocks(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))x <- extract_blocks(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$block)) # several localities: metropolitan area of Guadalajara gdl <- extract_blocks(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))
Extract the boundary of one or several localities
extract_locality(cve_edo, locality)extract_locality(cve_edo, locality)
cve_edo |
INEGI key of the state, from |
locality |
name of the locality (INEGI 2019), or a vector of names
for several localities, e.g. a metropolitan area. The most similar name
is used, so accents and capital letters do not matter. For Mexico City
( |
a sf object with the boundary of the locality (one row per locality).
Felipe Antonio Dzul Manzanilla [email protected].
merida <- extract_locality(cve_edo = "31", locality = "Merida") # metropolitan area of Guadalajara gdl <- extract_locality(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))merida <- extract_locality(cve_edo = "31", locality = "Merida") # metropolitan area of Guadalajara gdl <- extract_locality(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))
Extracts the electoral sections (secciones, INE 2020) that intersect the boundary of one or several localities.
extract_sectores(locality, cve_edo)extract_sectores(locality, cve_edo)
locality |
name of the locality (INEGI 2019), or a vector of names
for several localities, e.g. a metropolitan area. The most similar name
is used, so accents and capital letters do not matter. For Mexico City
( |
cve_edo |
INEGI key of the state, from |
a list with two sf objects: locality (the boundary of the
localities) and sectores (its sections).
Felipe Antonio Dzul Manzanilla [email protected].
x <- extract_sectores(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$sectores)) # several localities: metropolitan area of Guadalajara gdl <- extract_sectores(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))x <- extract_sectores(cve_edo = "31", locality = "Merida") plot(sf::st_geometry(x$sectores)) # several localities: metropolitan area of Guadalajara gdl <- extract_sectores(cve_edo = "14", locality = c("Guadalajara", "Zapopan", "Tonala", "Tlaquepaque"))
Returns a vector of most similar string in another vector. Returns a vector of the same length as input vector '.s'.
find_most_similar_string( .s, .t, max_dist = Inf, verbose = TRUE, ignore_case = TRUE, feeling_lucky = FALSE, ... )find_most_similar_string( .s, .t, max_dist = Inf, verbose = TRUE, ignore_case = TRUE, feeling_lucky = FALSE, ... )
.s |
a character vector to be matched. |
.t |
a character vector to be matched against. |
max_dist |
the maximum string distance |
verbose |
should warnings be printed in the console. |
ignore_case |
should case be ignored? Default is TRUE. |
feeling_lucky |
if multiple most similar strings are found. Should the first one be returned? |
... |
other arguments passed to utils::adist. |
Uses the generalized Levenshtein distance. For more information type ?utils::adist in the console. the original source is https://github.com/davidsjoberg/similiars/blob/master/R/similiars.R
a character vector
find_most_similar_string("merida", c("Merida", "Mexicali", "Monterrey"))find_most_similar_string("merida", c("Merida", "Mexicali", "Monterrey"))
High risk localities of Mexico
hrl_mxhrl_mx
A sf object with 150 rows and 8 variables:
the ids.
name of the localitie
type of localities
geometry column
...
This database was built using the SIMN annual goals dataset
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://geosis.mx/Aplicaciones/EntomologiayControl/Home/IndexNacional
A spatial dataset containing of the National Institute of Geography and Statistics INEGI ITER 2020
iter_2020_lociter_2020_loc
A sf object with 189432 rows and 10 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of tipo
is the simple feature
...
This datasets were published in July 26 2021.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/programas/ccpv/2020/#datos_abiertos
Polygons of localities from México of the National Institute of Geography and Statistics 2019 A spatial dataset containing of polygon data of localities from México
loc_inegi19_mxloc_inegi19_mx
A sf object with 49981 rows and 7 variables:
the numeric key. The key included the CVE_ENT and the CVE_MUN.
is the numeric key for each state.
is the string key to the Municipality.
is the string key of locality.
is a string value. Its the name of locality.
is a binary variable with two values, Urbana and Rural.
simple feature.
...
This datasets were published in september 2019.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://www.inegi.org.mx/temas/mg/#Descargas
Priority Urban Areas of Mexico
pua_mxpua_mx
A sf object with 111 rows and 3 variables:
the ids.
name of the priority urban area
geometry column
...
This database was built using data from high-risk locations, called hrl_mx in rgeomex
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://geosis.mx/Aplicaciones/EntomologiayControl/Home/IndexNacional
The datasets of rgeomex are downloaded the first time they are used and
kept in this folder. By default it is the user cache folder of R
(tools::R_user_dir("rgeomex", "cache")). Set the environment variable
RGEOMEX_DATA_DIR (or the option rgeomex.data_dir) to use another
folder, for example a shared folder or a folder that already has the files
(offline use).
rgeomex_cache_dir()rgeomex_cache_dir()
the path of the folder.
rgeomex_cache_dir()rgeomex_cache_dir()
Deletes the GeoParquet files of the cache folder. They are downloaded again when they are needed.
rgeomex_clear_cache()rgeomex_clear_cache()
the number of deleted files, invisibly.
## Not run: rgeomex_clear_cache() ## End(Not run)## Not run: rgeomex_clear_cache() ## End(Not run)
Table of the available datasets
rgeomex_datasets()rgeomex_datasets()
a data.frame with the name of each dataset, whether it is split by state and whether it has geometry.
rgeomex_datasets()rgeomex_datasets()
Reads a dataset of rgeomex. The file is downloaded the first time it is
used (see rgeomex_cache_dir()); later it is read from the cache.
rgeomex_load(dataset, cve_edo = NULL)rgeomex_load(dataset, cve_edo = NULL)
dataset |
name of the dataset (see |
cve_edo |
INEGI state key(s), from |
a sf object (a data.frame for "iter_2020_loc").
Felipe Antonio Dzul Manzanilla [email protected].
yuc <- rgeomex_load("AGEM_inegi19_mx", cve_edo = "31") blocks <- rgeomex_load("blocks_ine20_mx", cve_edo = "31")yuc <- rgeomex_load("AGEM_inegi19_mx", cve_edo = "31") blocks <- rgeomex_load("blocks_ine20_mx", cve_edo = "31")
A spatial dataset containing of polygon data of sectores from México
sectores_ine20_mx_asectores_ine20_mx_a
A sf object with 17833 rows and 7 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of tipo
is the simple feature
simple feature.
...
This datasets were published in october 2023.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
A spatial dataset containing of polygon data of sectores from México
sectores_ine20_mx_bsectores_ine20_mx_b
A sf object with 27428 rows and 7 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of tipo
is the simple feature
simple feature.
...
This datasets were published in october 2023.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
A spatial dataset containing of polygon data of sectores from México
sectores_ine20_mx_csectores_ine20_mx_c
A sf object with 23175 rows and 11 variables:
the ids.
the ids.
is the numeric key of state.
is the numeric key of federal district.
is the numeric key of federal district.
is the numeric key to the Municipality
is the numeric key to the Sectors
is numeric the key of tipo
is the simple feature
simple feature.
...
This datasets were published in october 2023.
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://pautas.ine.mx/transparencia/mapas/
Urban Areas of Mexico
ua_mxua_mx
A sf object with 658 rows and 2 variables:
the ids.
geometry column
...
La base de las area urbana de mexico derivada de la base de las areas global urbanas de meta data for goof of facebook
Downloaded from the GeoParquet release of rgeomex-py the first time it is used; see rgeomex_load().
https://dataforgood.facebook.com/dfg/tools/globalurbanareas