Interactive Operations with Shiny GUI

Introduction

Starting from version 0.9.0, amapGeocode includes a built-in Shiny application (amap_gui()) that provides a user-friendly graphical interface for all major package functions. This is particularly useful for users who prefer a GUI over command-line operations or for quick, interactive tasks.

To launch the application, simply run:

library(amapGeocode)
amap_gui()

Features

The Shiny application is organized into four main tabs, mirroring the package’s core functionality:

1. Geocoding (Address to Coordinate)

The Geocoding tab allows you to convert addresses into longitude and latitude coordinates.

2. Reverse Geocoding (Coordinate to Address)

The Reverse Geocoding tab converts coordinates back into structured addresses and administrative information.

3. Coordinate Conversion

The Convert Coords tab handles coordinate system transformations.

4. Settings

Configure global API settings directly within the app:

Workflow Example

  1. Launch the App: Run amapGeocode::amap_gui().
  2. Configure API Key: Go to the Settings tab and verify your API key is present.
  3. Perform Task:
    • Navigate to the Geocoding tab.
    • Select “Batch File (CSV)” mode.
    • Upload your addresses.csv.
    • Select the column name that contains your addresses.
    • Click Batch Process.
  4. Download Results: Once processing is complete, a “Download Results” button will appear. Click it to save the geocoded data to your local machine.

Dependencies

The GUI requires the following additional R packages: * shiny * bslib (for the modern UI theme) * DT (for interactive data tables) * readr (for fast file I/O)

The app will check for these packages on startup and prompt you to install them if they are missing.