nl_geocode returns for a vector of addresses the most probable object/location. This function is more user friendly than the barebones webservices (nl_free), and uses the same function signature as ggmap::geocode.

nl_geocode(location, output = c("wgs84", "rd", "data.frame"),
  messaging = FALSE, type = "adres", ..., verbose = messaging)

nl_geocode_rd(location, messaging = FALSE, type = "adres", ...,
  verbose = messaging)

nl_geocode_df(location, messaging = FALSE, type = "adres", ...,
  verbose = messaging)

Arguments

location

string with location to be found

output

Should the output be a data.frame or sf object in wgs84 or Rijksdriehoekstelsel format?

messaging

Print the urls fired to the webserver (consistent with `ggmap::geocode`)

type

restrict the type of object that is returned from the service, see details for possible types.

...

will be passed to nl_free.

verbose

identical to messaging (consistent with other nlgeoder functions)

Value

The return type can be specified and can be of type "sf" or "data.frame", depending on the value of output.

Details

type can be one or more of the following: "provincie", "gemeente" , "woonplaats", "weg", "postcode", "adres", "perceel", "hectometerpaal", "wijk", "buurt", "waterschapsgrens", "appartementsrecht".

Examples

data("addresses") r <- nl_geocode(addresses$Address) r["weergavenaam"]
#> Simple feature collection with 5 features and 1 field #> geometry type: POINT #> dimension: XY #> bbox: xmin: 6.563506 ymin: 53.21085 xmax: 6.57079 ymax: 53.21978 #> epsg (SRID): 4326 #> proj4string: +proj=longlat +datum=WGS84 +no_defs #> weergavenaam centroide_ll #> 1 Martinikerkhof 3, 9712JG Groningen POINT (6.568567 53.21927) #> 2 Sint Jansstraat 4, 9712JN Groningen POINT (6.57079 53.21978) #> 3 Museumeiland 1, 9711ME Groningen POINT (6.566075 53.21247) #> 4 Stationsplein 4, 9726AE Groningen POINT (6.563506 53.21085) #> 5 Hereplein 73, 9711GD Groningen POINT (6.569384 53.21396)
names(r)
#> [1] "bron" "woonplaatscode" "type" #> [4] "woonplaatsnaam" "wijkcode" "huis_nlt" #> [7] "openbareruimtetype" "buurtnaam" "gemeentecode" #> [10] "weergavenaam" "straatnaam_verkort" "id" #> [13] "gekoppeld_perceel" "gemeentenaam" "buurtcode" #> [16] "wijknaam" "identificatie" "openbareruimte_id" #> [19] "waterschapsnaam" "provinciecode" "postcode" #> [22] "provincienaam" "nummeraanduiding_id" "waterschapscode" #> [25] "adresseerbaarobject_id" "huisnummer" "provincieafkorting" #> [28] "centroide_rd" "straatnaam" "score" #> [31] "centroide_ll"