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")