Skip to contents

The function address_to_coords can be used to find coordinates to supplied Norwegian addresses. Internet access is required as the function utilizes the Norwegian Mapping Authority’s address API.

Usage

address_to_coords(zip_code, address, format = "sf", crs_out = 25833)

Arguments

zip_code

Character vector with zip codes.

address

Character vector with addresses (street name and house number).

format

Format of the returned object. Default value is set to “sf” (which returns an sf object). It is also possible set the format to “tibble” or “data.frame”.

crs_out

Numeric vector with the chosen coordinate reference system (CRS). Default value is set to CRS 25833.

Value

Object with coordinates to the supplied addresses.

Details

If there are no coordinates found for the supplied address it means that it does not exist in Matrikkelen - Norway's official property register. See www.rettikartet.no to search for existing addresses.

Examples

address_to_coords(zip_code = "0185", address = "Schweigaards gate 10")
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 262876.8 ymin: 6649176 xmax: 262876.8 ymax: 6649176
#> Projected CRS: ETRS89 / UTM zone 33N
#>                   address zip_code kommunenummer kommunenavn ID
#> 0185 Schweigaards gate 10     0185          0301        OSLO  1
#>                      geometry
#> 0185 POINT (262876.8 6649176)