Getting Started with Argentum

Introduction

Argentum is an R package that simplifies access to WFS (Web Feature Service) and WMS (Web Map Service) data from various Argentine organizations. This vignette will guide you through the basic usage of the package.

Installation

You can install the development version of Argentum from GitHub:

# install.packages("devtools")
devtools::install_github("your-username/Argentum")

Basic Usage

Listing Available Organizations

The first step is to see what organizations have available data:

library(Argentum)

# Get list of organizations
organizations <- argentum_list_organizations()
print(organizations)

This will show you a data frame with organizations and their WFS/WMS URLs.

Selecting an Organization

You can select an organization either interactively or programmatically:

# Interactive selection
selected_org <- argentum_select_organization()

# Search for specific organizations
buenos_aires_org <- argentum_select_organization(search = "Buenos Aires")

Listing Available Layers

Once you’ve selected an organization, you can see what layers they provide:

# List available layers
layers <- argentum_list_layers(selected_org$Name)
print(layers)

Importing Data

To import a specific layer:

# Import a specific layer
sf_layer <- argentum_import_wfs_layer(
  wfs_url = selected_org$WFS_URL,
  layer_name = layers$Name[1]
)

# Basic plot of the imported data
plot(sf_layer)

Interactive Import

For a guided experience, use the interactive import function:

sf_layer <- argentum_interactive_import()

This will guide you through the process step by step.

Error Handling

Argentum includes robust error handling. Here’s how to use it:

tryCatch({
  sf_layer <- argentum_import_wfs_layer(
    wfs_url = "http://example.com/wfs",
    layer_name = "example_layer"
  )
}, error = function(e) {
  message("Error occurred: ", e$message)
})

Next Steps

For more detailed information about working with WFS and WMS services, see the “Working with WFS/WMS Services” vignette:

vignette("argentum", package = "Argentum")