| gisco_address_api | R Documentation |
Functions to interact with the GISCO Address API, which supports geocoding and reverse geocoding with a pan-European address database.
Each endpoint is implemented through a specific function. See Details.
The API supports fuzzy searching, also referred to as approximate string matching, for all arguments of each endpoint.
gisco_address_api_search(
country = NULL,
province = NULL,
city = NULL,
road = NULL,
housenumber = NULL,
postcode = NULL,
verbose = FALSE
)
gisco_address_api_reverse(x, y, country = NULL, verbose = FALSE)
gisco_address_api_bbox(
country = NULL,
province = NULL,
city = NULL,
road = NULL,
postcode = NULL,
verbose = FALSE
)
gisco_address_api_countries(verbose = FALSE)
gisco_address_api_provinces(country = NULL, city = NULL, verbose = FALSE)
gisco_address_api_cities(country = NULL, province = NULL, verbose = FALSE)
gisco_address_api_roads(
country = NULL,
province = NULL,
city = NULL,
verbose = FALSE
)
gisco_address_api_housenumbers(
country = NULL,
province = NULL,
city = NULL,
road = NULL,
postcode = NULL,
verbose = FALSE
)
gisco_address_api_postcodes(
country = NULL,
province = NULL,
city = NULL,
verbose = FALSE
)
gisco_address_api_copyright(verbose = FALSE)
country |
A country code ( |
province |
A province within a country. For a list of provinces within
a country, use the provinces endpoint
( |
city |
A city within a province. For a list of cities within a
province, use the cities endpoint
( |
road |
A road within a city. |
housenumber |
The house number or house name within a road or street. |
postcode |
A postcode to use with the previous arguments. |
verbose |
A logical value. If |
x, y |
Longitude and latitude coordinates to convert into a human-readable address. |
The following table describes the API endpoints, based on the GISCO Address API endpoint documentation:
| Endpoint | Description |
/countries | All country codes compatible with the address API. Check the coverage map for available countries and see the list of official country codes. |
/provinces | All provinces within the specified country. It can also retrieve the province for a specified city. |
/cities | All cities within a specified province or country. |
/roads | All roads or streets within a specified city. |
/housenumbers | All house numbers or names within the specified road. In some countries, an address may not have a road component. If a road is not specified, the API returns at most 1,000 house numbers. |
/postcodes | All postcodes within the specified address component, such as country, province or city. |
/search | Structured queries to the address database. Various argument combinations can retrieve addresses that share an address component. The API returns at most 100 addresses. |
/reverse | A structured address for longitude and latitude coordinates. |
/bbox | A WKT bounding box for an address component, depending on the specified arguments. |
/copyright | The copyright text for each available country in the Address API. |
The resulting object may include these variables:
| Property name | Description |
LD | Locator designator, which represents the house number part of the address. |
TF | Thoroughfare, which represents the street or road part of the address. |
L0 | Level 0 of the API administrative levels. Values are two-character country codes. |
L1 | Level 1 of the API administrative levels. Values are province names. "Province" is a generic term that may vary by country. |
L2 | Level 2 of the API administrative levels. Values are town or city names. "City" is a generic term that may vary by country. |
PC | Postal code. |
N0 | NUTS 0. |
N1 | NUTS 1. |
N2 | NUTS 2. |
N3 | NUTS 3. |
X and Y | Longitude and latitude coordinates of the address point. |
OL | The Open Location Code for the address. |
A tibble in most cases, except
gisco_address_api_search(), gisco_address_api_reverse() and
gisco_address_api_bbox(), which return a sf object.
https://gisco-services.ec.europa.eu/addressapi/docs/screen/home.
See the GISCO Address API documentation at https://gisco-services.ec.europa.eu/addressapi/docs/screen/home.
Other API tools:
gisco_id_api
# Cities in a region.
gisco_address_api_cities(country = "PT", province = "LISBOA")
# Geocode and reverse geocode with `sf` objects.
# Structured search.
struct <- gisco_address_api_search(
country = "ES", city = "BARCELONA",
road = "GRACIA"
)
struct
# Reverse geocoding.
reverse <- gisco_address_api_reverse(x = struct$X[1], y = struct$Y[1])
reverse
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.