extractAdmin: Extract subordinate administrative regions from a district...

View source: R/getAdmin.R

extractAdminR Documentation

Extract subordinate administrative regions from a district response

Description

Extract subordinate administrative regions from a district response

Usage

extractAdmin(res, include_polyline = FALSE)

Arguments

res

Required. Response object returned by [getAdmin()] with 'output = "JSON"' or by the AutoNavi district API.

include_polyline

Logical indicating whether to include the polyline column (requires 'extensions = "all"'). Defaults to 'FALSE'.

Value

A 'tibble' describing each administrative region present in the response. The table includes parent metadata ('parent_name', 'parent_adcode', 'parent_level'), centre coordinates ('lng', 'lat'), and a 'depth' column describing the nesting level (0 for the matched region, 1+ for subregions). When no results are present a single placeholder row filled with 'NA' values is returned.

See Also

[getAdmin()]

Examples

## Not run: 
raw <- getAdmin("Sichuan Province", output = "JSON")
extractAdmin(raw)

## End(Not run)


amapGeocode documentation built on Jan. 19, 2026, 9:07 a.m.