Learn R Programming

geouy

geouy is an R package that allows users to easily access official spatial data sets of Uruguay. The package includes a wide range of geospatial datasets as simple features (sf), available at various geographic scales and for various years with harmonized attributes and projection (see detailed list below).

Installation

# From CRAN
  install.packages("geouy")
  library(geouy)
  
# Use the development version with latest features
  utils::remove.packages('geouy')
  devtools::install_github("RichDeto/geouy")
  library(geouy)

obs. If you use Linux, you need to install a couple dependencies before installing the libraries sf and geouy. More info here.

Basic Usage

load_geouy

The syntax of all geouy functions operate one the same logic so it becomes intuitive to download any data set using a single line of code. Like this:

secc <- load_geouy("Secciones")

Available datasets:

Administrative limits
LayerProductorSourceYearFormat
"Uruguay""INE"MIDES2011wfs
"Areas administrativas""SGM"SGM2011wfs
"Deptos""INE"IDE2011wfs
"Dptos""DINAMA""MVOTMA"2020wfs
"Limites departamentales""IGM""IGM"2011wfs
"Departamentos""IDE""MIDES"2011wfs
"Secciones""INE Censo"MIDES2011wfs
"Segmentos""INE Censo"MIDES2011wfs
"Zonas""INE Censo"MIDES2011wfs
"Secc MVD 2004""INE"MIDES2004wfs
"Segm MVD 2004""INE"MIDES2004wfs
"Segm URB INT 2004""INE"MIDES2004wfs
"Zonas MVD 2004""INE"MIDES2004wfs
"Zonas URB INT 2004""INE"MIDES2004wfs
"Localidades pg""INE Censo"MIDES2011wfs
"Localidades pt""INE Censo"MIDES2011wfs
"Centros poblados pg""SGM"SGM2011wfs
"Centros poblados pt""SGM"SGM2011wfs
"Municipios10""DINOT-IM-IC"MVOTMA2010zip
"Municipios15""DINOT-IM-IC"MVOTMA2015zip
"CCZ""INE"MIDES2011wfs
"Asentamientos irregulares""PMB"MIDES2014wfs
"Barrios""INE"MIDES2011wfs
"Balnearios""MTOP"MTOP2017wfs
"Secciones catastrales""DNC"MVOTMA2013zip
"Padrones rurales""DNC""MVOTMA"2014zip
"Padrones urbanos""DNC"MVOTMA2014zip
"Secciones policiales""MI"MVOTMA2017zip
Demography
LayerProductorSourceYearFormat
"LocHog11""INE"IDE2011zip
"LocPobHom11""INE"IDE2011zip
"LocPobMuj11""INE"IDE2011zip
"LocViv11""INE"IDE2011zip
Hidrology
LayerProductorSourceYearFormat
"Cuencas hidro N1""DINAGUA"MVOTMA2020zip
"Cuencas hidro N2""DINAGUA"MVOTMA2020zip
"Cuencas hidro N3""DINAGUA"MVOTMA2020zip
"Cuencas hidro N4""DINAGUA"MVOTMA2020zip
"Cuencas hidro N5""DINAGUA"MVOTMA2020zip
"Cursos de agua navegables y flotables""MTOP"MTOP2019wfs
"Lagunas publicas""MTOP"MTOP2019wfs
"Ambientes acuaticos""FREPLATA"MVOTMA2009zip
"Areas protegidas"DINAMA"MVOTMA2015zip
"Baniados""DINAMA"MVOTMANAzip
"Batimetria""DINAMA"MVOTMA2020zip
Ways
LayerProductorSourceYearFormat
"Rutas""IDE"MIDES2017wfs
"Calles""IDE - UTE - IM"MIDES2017wfs
"Peajes""MTOP"MTOP2019wfs
"Postes Kilometros""MTOP"MTOP2019wfs
Services
LayerProductorSourceYearFormat
"OTs""MIDES"MIDES2022zip
"Educación en Primera Infancia e Inicial""CEIP"MIDES2020zip
"Jardines de infantes""CEIP"MIDES2020zip
"Colegios privados N0a3""CEIP"MIDES2020zip
"Escuelas con N3""CEIP"MIDES2020zip
"Escuelas""CEIP"MIDES2020zip
"Educacion especial""CEIP"MIDES2020zip
"Educacion secundaria""CEIP"MIDES2020zip
"UTU""ANEP"MIDES2020zip
"Instituciones deportivas""IDE"MIDES2015wfs
"Playas""DINAMA¨MVOTMA2007zip
Orthophotos
LayerProductorSourceYearFormat
"Grilla ortofotos urbana""IDE"IDE2019wfs
"Grilla ortofotos nacional""IDE"IDE2019wfs
Land Cover
LayerProductorSourceYearFormat
"Cobertura suelo 2000""DINAGUA"MVOTMA2000zip
"Cobertura suelo 2008""DINAGUA"MVOTMA2008zip
"Cobertura suelo 2011""DINAGUA"MVOTMA2011zip
"Cobertura suelo 2015""DINAGUA"MVOTMA2015zip
"CONEAT""RENARE""RENARE"NAwfs

which_uy()

Add to an sf object its spatial coincidence with one or more administrative units in Uruguay, generating the corresponding variables.

where_uy()

You get an sf object of one or more administrative units in Uruguay, according to a query by code or name in the layer.

add_geom()

This function allows you to add a geom variable with a code variable of "zona", "barrio", "localidad", "segmentos", "secciones" or "departamentos".

geocode_ide_uy()

Allows geocoding directions using IDE_uy.

plot_geouy()

Plot a variable of your sf object with north and scale, set on a simple theme.

Other functions:

is.uy4326(): Test if an sf object match with Uruguay at crs = 4326. is.uy32721(): Test if an sf object match with Uruguay at crs = 32721. is.uy5381(): Test if an sf object match with Uruguay at crs = 5381. is.uy5382(): Test if an sf object match with Uruguay at crs = 5382.

Datasets

metadata

This dataset has the metadata of all vector geometries provided by geouy and detailed at the top

metadata_wms

This dataset has the metadata of all the raster services that will be provided by geouy, although the functions are still under development.

loc_agr_ine

This dataset allows you to aggregate Localidades INE by the aglomerations used by INE. An example of use can be:

loc <- which_uy(base, "Localidades pg") %>% 
    dplyr::left_join(loc_agr_ine, by = c("cod_Localidades pg" = "codloc"))

uy_deptos_grid and mvd_barrios_grid

Two datasets to use as geofacet grid dataset for departments of Uruguay and neighborhoods of Montevideo.

History

This package arises from the conjugation of own ideas with an eye on the region. It started as a part of the package where I work with @calcita at ech, and some geospatial service packages in the region mainly: geobr and chilemapas

This walk on the shoulders of giants, allows this package focused on this small country (my beautiful Uruguay), to have its own particularities although it tries to fit especially to geobr in its structure and with a view to complementing ech.

Community contributions es

This package intends to incorporate any function of general requirements that use the geographic data of Uruguay as a base. All contributions in this regard are welcome.

If you work with geographic data of Uruguay and want to add your function or data, we recommend that you read the following tips on how to collaborate:

To add your function:

- Fork of this repository
- Add your function as an `.R` file in the `R/` folder with the same name as the function
- Document it with `roxygen2` clarifying its functionality, parameters and an example of use. To see how it is documented to review another function in the same directory
- Remember at the end of the documentation you must add a # '@export
- Check that the types and values of your function parameters are fine (for example, you can look at `data-raw/metadata.R`
- Add the dependencies in the `DESCRIPTION` file 
- Check the package with devtools::check()
- If everything works fine, then make a pull request

To add geographic data to the load_geouy() function:

- Fork of this repository
- Identify the corresponding WFS service URL
- Add a record to the `metadata` file in the `data-raw/` directory, with the corresponding data.
- Also include this record in the corresponding table of the `README.md` file, with the corresponding format.
- If everything works fine, then make a pull request

Citation

To cite geouy in publications, please use:

Detomasi, Richard (2021) "geouy: Geographic Information of Uruguay". R package version 0.2.5 URL: https://github.com/RichDeto/geouy.

A BibTeX entry for LaTeX users is:

@Misc{geouy,
  title = {geouy: Geographic Information of Uruguay},
  author = {Richard Detomasi},
  note = {R package version 0.2.5},
  year = {2021},
  url  = {https://github.com/RichDeto/geouy},
}

Copy Link

Version

Install

install.packages('geouy')

Monthly Downloads

98

Version

0.2.6

License

GPL-3

Maintainer

Richard Detomasi

Last Published

October 5th, 2022

Functions in geouy (0.2.6)

geocode_ide_uy

A function to geocoding directions using IDE_uy
mvd_barrios_grid

Montevideo barrios grid
where_uy

This function return an 'sf' object with the geometry of the consult id or group of ids, of an administrative units in Uruguay.
metadata

Metadata of geoservices for Uruguay
%>%

Pipe operator
uy_deptos_grid

Uruguay Departments grid
loc_agr_ine

INE "Localidades Agregadas"
metadata_tables

Metadata of tables for Uruguay
metadata_wms

Metadata of WMS for Uruguay
plot_geouy

plot_geouy
reverse_ide_uy

A function to reverse geocoding from coordinates (EPSG 4326) using IDE_uy
which_uy

This function allows to add to an 'sf' object its spatial coincidence with one or more administrative units in Uruguay, generating the corresponding variables.
tiles_geouy

This function allows to Download .jpg or .tif files from the IDEuy tiles repository, according to a 'sf' object bbox.
geouy

geouy package
load_geouy

This function allows to take oficial uruguayan geometries, as object "sf", from various servers.
is.uy32721

This function test if an 'sf' object match with Uruguay at crs = 32721.
add_geom

This function allows you to add a geom variable with a code variable of "zona", "barrio", "localidad", "segmentos", "secciones" or "departamentos".
is.uy5381

This function test if an 'sf' object match with Uruguay at crs = 5381.
is.uy5382

This function test if an 'sf' object match with Uruguay at crs = 5382.
is.uy4326

This function test if an 'sf' object match with Uruguay at crs = 4326.