rk.cartographr

An RKWard plugin package for creating beautiful maps using the cartographr R package. This plugin provides a graphical user interface (GUI) to fetch data from OpenStreetMap and generate customizable map plots directly within RKWard.

Features

Installation

You can install this plugin package directly from GitHub using the devtools package in R.

# install.packages("devtools") # If you don't have it installed
# devtools::install_github("AlfCano/rk.cartographr")
install.packages("rk.cartographr", repos = c('https://alfcano.r-universe.dev', 'https://cloud.r-project.org'))

After installation, restart RKWard for the plugin to appear in the menus.

Hierarchy

Screenshot of the path in the main menu.

Usage Workflow

The workflow is designed in two main steps: first fetching the data, then plotting it.

Step 1: Get Open Street Map Data

  1. Navigate to the RKWard menu: Plots -> Open Street Map -> Get Open Street Map Data.
  2. Paste the full URL from OpenStreetMap (e.g., https://www.openstreetmap.org/#map=12/19.0537/-98.2775) into the OpenStreetMap URL field. The plugin will automatically parse the latitude and longitude.
Get map

Screenshot of the RKWard interface operating the rk.cartographr Map Obtaining module, showing the Data Source configuration and Dimensions selection.

  1. Adjust the X Distance and Y Distance (in meters) to define the map area you want to capture.
  2. Optionally, change the output size or the name of the object to be saved (it defaults to map).
  3. Click Submit. This will run the get_osmdata() function and create an sf object in your R environment.

Step 2: Plot Cartographr Map

  1. Navigate to the RKWard menu: Plots -> Open Street Map -> Plot Cartographr Map.
  2. In the Data & Style tab, select the sf object you just created (e.g., map) from the data selector.
Join espacial

Screenshot of the RKWard interface operating the rk.cartographr Choropleth Maps module, showing spatial join configuration and palette selection.

  1. Choose your desired Color Palette. The preview pane on the right will update automatically.
Render

Screenshot of the rendering device showing the output of the resulting thematic map, with cartographic aesthetic elements ready for publication.

  1. Use the Labels tab to add a title, subtitle, or caption to your map.
  2. Use the Output Device tab to control the properties of the final image file, such as resolution and dimensions.
  3. Click Submit to generate the final plot in the RKWard output window.

Dependencies

This plugin requires the following R packages to be installed:

Author

Alfonso Cano Robles (alfonso.cano@correo.buap.mx) With assitance of Gemini a LLM from Google.

License

This plugin is licensed under the GPL (>= 3).