Skip to contents

Returns nearest outward codes for a given longitude and latitude. The search is based on the relative distance of the outcode centroid.

Usage

nearest_outcode_lonlat(longitude, latitude)

Arguments

longitude

A string or numeric. Needs to have at least three decimal points.

latitude

A string or numeric. Needs to have at least three decimal points.

Value

A list with available data.

See also

postcode_lookup for documentation.

Examples

# \donttest{
nearest_outcode_lonlat(0.127, 51.507)
#> [[1]]
#> [[1]]$outcode
#> [1] "DA18"
#> 
#> [[1]]$longitude
#> [1] 0.1361793
#> 
#> [[1]]$latitude
#> [1] 51.49426
#> 
#> [[1]]$northings
#> [1] 179421
#> 
#> [[1]]$eastings
#> [1] 548390
#> 
#> [[1]]$admin_district
#> [[1]]$admin_district[[1]]
#> [1] "Bexley"
#> 
#> 
#> [[1]]$parish
#> [[1]]$parish[[1]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[1]]$admin_county
#> list()
#> 
#> [[1]]$admin_ward
#> [[1]]$admin_ward[[1]]
#> [1] "Slade Green & Northend"
#> 
#> [[1]]$admin_ward[[2]]
#> [1] "Thamesmead East"
#> 
#> 
#> [[1]]$country
#> [[1]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[2]]
#> [[2]]$outcode
#> [1] "SE28"
#> 
#> [[2]]$longitude
#> [1] 0.1044329
#> 
#> [[2]]$latitude
#> [1] 51.50235
#> 
#> [[2]]$northings
#> [1] 180256
#> 
#> [[2]]$eastings
#> [1] 546160
#> 
#> [[2]]$admin_district
#> [[2]]$admin_district[[1]]
#> [1] "Greenwich"
#> 
#> [[2]]$admin_district[[2]]
#> [1] "Bexley"
#> 
#> 
#> [[2]]$parish
#> [[2]]$parish[[1]]
#> [1] "Greenwich, unparished area"
#> 
#> [[2]]$parish[[2]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[2]]$admin_county
#> list()
#> 
#> [[2]]$admin_ward
#> [[2]]$admin_ward[[1]]
#> [1] "Plumstead"
#> 
#> [[2]]$admin_ward[[2]]
#> [1] "Glyndon"
#> 
#> [[2]]$admin_ward[[3]]
#> [1] "Thamesmead Moorings"
#> 
#> [[2]]$admin_ward[[4]]
#> [1] "Thamesmead East"
#> 
#> 
#> [[2]]$country
#> [[2]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[3]]
#> [[3]]$outcode
#> [1] "SE2"
#> 
#> [[3]]$longitude
#> [1] 0.1161223
#> 
#> [[3]]$latitude
#> [1] 51.48987
#> 
#> [[3]]$northings
#> [1] 178892
#> 
#> [[3]]$eastings
#> [1] 547012
#> 
#> [[3]]$admin_district
#> [[3]]$admin_district[[1]]
#> [1] "Greenwich"
#> 
#> [[3]]$admin_district[[2]]
#> [1] "Bexley"
#> 
#> 
#> [[3]]$parish
#> [[3]]$parish[[1]]
#> [1] "Greenwich, unparished area"
#> 
#> [[3]]$parish[[2]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[3]]$admin_county
#> list()
#> 
#> [[3]]$admin_ward
#> [[3]]$admin_ward[[1]]
#> [1] "Plumstead"
#> 
#> [[3]]$admin_ward[[2]]
#> [1] "West Heath"
#> 
#> [[3]]$admin_ward[[3]]
#> [1] "Belvedere"
#> 
#> [[3]]$admin_ward[[4]]
#> [1] "Thamesmead Moorings"
#> 
#> [[3]]$admin_ward[[5]]
#> [1] "Abbey Wood"
#> 
#> [[3]]$admin_ward[[6]]
#> [1] "Thamesmead East"
#> 
#> 
#> [[3]]$country
#> [[3]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[4]]
#> [[4]]$outcode
#> [1] "DA17"
#> 
#> [[4]]$longitude
#> [1] 0.149148
#> 
#> [[4]]$latitude
#> [1] 51.48621
#> 
#> [[4]]$northings
#> [1] 178552
#> 
#> [[4]]$eastings
#> [1] 549316
#> 
#> [[4]]$admin_district
#> [[4]]$admin_district[[1]]
#> [1] "Bexley"
#> 
#> [[4]]$admin_district[[2]]
#> [1] "Dartford"
#> 
#> 
#> [[4]]$parish
#> [[4]]$parish[[1]]
#> [1] "Dartford, unparished area"
#> 
#> [[4]]$parish[[2]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[4]]$admin_county
#> [[4]]$admin_county[[1]]
#> [1] "Kent"
#> 
#> 
#> [[4]]$admin_ward
#> [[4]]$admin_ward[[1]]
#> [1] "West Heath"
#> 
#> [[4]]$admin_ward[[2]]
#> [1] "Belvedere"
#> 
#> [[4]]$admin_ward[[3]]
#> [1] "Erith"
#> 
#> [[4]]$admin_ward[[4]]
#> [1] "Northumberland Heath"
#> 
#> [[4]]$admin_ward[[5]]
#> [1] "West Hill"
#> 
#> 
#> [[4]]$country
#> [[4]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[5]]
#> [[5]]$outcode
#> [1] "RM9"
#> 
#> [[5]]$longitude
#> [1] 0.1339287
#> 
#> [[5]]$latitude
#> [1] 51.54092
#> 
#> [[5]]$northings
#> [1] 184604
#> 
#> [[5]]$eastings
#> [1] 548082
#> 
#> [[5]]$admin_district
#> [[5]]$admin_district[[1]]
#> [1] "Havering"
#> 
#> [[5]]$admin_district[[2]]
#> [1] "Barking and Dagenham"
#> 
#> 
#> [[5]]$parish
#> [[5]]$parish[[1]]
#> [1] "Barking and Dagenham, unparished area"
#> 
#> [[5]]$parish[[2]]
#> [1] "Havering, unparished area"
#> 
#> 
#> [[5]]$admin_county
#> list()
#> 
#> [[5]]$admin_ward
#> [[5]]$admin_ward[[1]]
#> [1] "Mayesbrook"
#> 
#> [[5]]$admin_ward[[2]]
#> [1] "Parsloes"
#> 
#> [[5]]$admin_ward[[3]]
#> [1] "Thames"
#> 
#> [[5]]$admin_ward[[4]]
#> [1] "Heath"
#> 
#> [[5]]$admin_ward[[5]]
#> [1] "Goresbrook"
#> 
#> [[5]]$admin_ward[[6]]
#> [1] "South Hornchurch"
#> 
#> [[5]]$admin_ward[[7]]
#> [1] "Eastbury"
#> 
#> [[5]]$admin_ward[[8]]
#> [1] "Alibon"
#> 
#> [[5]]$admin_ward[[9]]
#> [1] "River"
#> 
#> 
#> [[5]]$country
#> [[5]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[6]]
#> [[6]]$outcode
#> [1] "IG11"
#> 
#> [[6]]$longitude
#> [1] 0.09324855
#> 
#> [[6]]$latitude
#> [1] 51.53495
#> 
#> [[6]]$northings
#> [1] 183860
#> 
#> [[6]]$eastings
#> [1] 545280
#> 
#> [[6]]$admin_district
#> [[6]]$admin_district[[1]]
#> [1] "Barking and Dagenham"
#> 
#> [[6]]$admin_district[[2]]
#> [1] "Newham"
#> 
#> [[6]]$admin_district[[3]]
#> [1] "Redbridge"
#> 
#> 
#> [[6]]$parish
#> [[6]]$parish[[1]]
#> [1] "Barking and Dagenham, unparished area"
#> 
#> [[6]]$parish[[2]]
#> [1] "Redbridge, unparished area"
#> 
#> [[6]]$parish[[3]]
#> [1] "Newham, unparished area"
#> 
#> 
#> [[6]]$admin_county
#> list()
#> 
#> [[6]]$admin_ward
#> [[6]]$admin_ward[[1]]
#> [1] "Longbridge"
#> 
#> [[6]]$admin_ward[[2]]
#> [1] "Becontree"
#> 
#> [[6]]$admin_ward[[3]]
#> [1] "Thames"
#> 
#> [[6]]$admin_ward[[4]]
#> [1] "East Ham South"
#> 
#> [[6]]$admin_ward[[5]]
#> [1] "Beckton"
#> 
#> [[6]]$admin_ward[[6]]
#> [1] "Mayfield"
#> 
#> [[6]]$admin_ward[[7]]
#> [1] "Eastbury"
#> 
#> [[6]]$admin_ward[[8]]
#> [1] "Abbey"
#> 
#> [[6]]$admin_ward[[9]]
#> [1] "Gascoigne"
#> 
#> 
#> [[6]]$country
#> [[6]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[7]]
#> [[7]]$outcode
#> [1] "SE18"
#> 
#> [[7]]$longitude
#> [1] 0.07268226
#> 
#> [[7]]$latitude
#> [1] 51.48435
#> 
#> [[7]]$northings
#> [1] 178192
#> 
#> [[7]]$eastings
#> [1] 544013
#> 
#> [[7]]$admin_district
#> [[7]]$admin_district[[1]]
#> [1] "Greenwich"
#> 
#> 
#> [[7]]$parish
#> [[7]]$parish[[1]]
#> [1] "Greenwich, unparished area"
#> 
#> 
#> [[7]]$admin_county
#> list()
#> 
#> [[7]]$admin_ward
#> [[7]]$admin_ward[[1]]
#> [1] "Plumstead"
#> 
#> [[7]]$admin_ward[[2]]
#> [1] "Glyndon"
#> 
#> [[7]]$admin_ward[[3]]
#> [1] "Woolwich Riverside"
#> 
#> [[7]]$admin_ward[[4]]
#> [1] "Shooters Hill"
#> 
#> [[7]]$admin_ward[[5]]
#> [1] "Kidbrooke with Hornfair"
#> 
#> [[7]]$admin_ward[[6]]
#> [1] "Woolwich Common"
#> 
#> 
#> [[7]]$country
#> [[7]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[8]]
#> [[8]]$outcode
#> [1] "RM10"
#> 
#> [[8]]$longitude
#> [1] 0.1578807
#> 
#> [[8]]$latitude
#> [1] 51.54491
#> 
#> [[8]]$northings
#> [1] 185098
#> 
#> [[8]]$eastings
#> [1] 549730
#> 
#> [[8]]$admin_district
#> [[8]]$admin_district[[1]]
#> [1] "Barking and Dagenham"
#> 
#> 
#> [[8]]$parish
#> [[8]]$parish[[1]]
#> [1] "Barking and Dagenham, unparished area"
#> 
#> 
#> [[8]]$admin_county
#> list()
#> 
#> [[8]]$admin_ward
#> [[8]]$admin_ward[[1]]
#> [1] "Heath"
#> 
#> [[8]]$admin_ward[[2]]
#> [1] "Village"
#> 
#> [[8]]$admin_ward[[3]]
#> [1] "Alibon"
#> 
#> [[8]]$admin_ward[[4]]
#> [1] "River"
#> 
#> [[8]]$admin_ward[[5]]
#> [1] "Eastbrook"
#> 
#> 
#> [[8]]$country
#> [[8]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[9]]
#> [[9]]$outcode
#> [1] "DA7"
#> 
#> [[9]]$longitude
#> [1] 0.1459452
#> 
#> [[9]]$latitude
#> [1] 51.4656
#> 
#> [[9]]$northings
#> [1] 176254
#> 
#> [[9]]$eastings
#> [1] 549161
#> 
#> [[9]]$admin_district
#> [[9]]$admin_district[[1]]
#> [1] "Bexley"
#> 
#> 
#> [[9]]$parish
#> [[9]]$parish[[1]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[9]]$admin_county
#> list()
#> 
#> [[9]]$admin_ward
#> [[9]]$admin_ward[[1]]
#> [1] "Bexleyheath"
#> 
#> [[9]]$admin_ward[[2]]
#> [1] "Crook Log"
#> 
#> [[9]]$admin_ward[[3]]
#> [1] "West Heath"
#> 
#> [[9]]$admin_ward[[4]]
#> [1] "Northumberland Heath"
#> 
#> [[9]]$admin_ward[[5]]
#> [1] "Crayford"
#> 
#> [[9]]$admin_ward[[6]]
#> [1] "Barnehurst"
#> 
#> 
#> [[9]]$country
#> [[9]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
#> [[10]]
#> [[10]]$outcode
#> [1] "DA8"
#> 
#> [[10]]$longitude
#> [1] 0.175757
#> 
#> [[10]]$latitude
#> [1] 51.47574
#> 
#> [[10]]$northings
#> [1] 177442
#> 
#> [[10]]$eastings
#> [1] 551198
#> 
#> [[10]]$admin_district
#> [[10]]$admin_district[[1]]
#> [1] "Bexley"
#> 
#> 
#> [[10]]$parish
#> [[10]]$parish[[1]]
#> [1] "Bexley, unparished area"
#> 
#> 
#> [[10]]$admin_county
#> list()
#> 
#> [[10]]$admin_ward
#> [[10]]$admin_ward[[1]]
#> [1] "Belvedere"
#> 
#> [[10]]$admin_ward[[2]]
#> [1] "Erith"
#> 
#> [[10]]$admin_ward[[3]]
#> [1] "Northumberland Heath"
#> 
#> [[10]]$admin_ward[[4]]
#> [1] "Slade Green & Northend"
#> 
#> [[10]]$admin_ward[[5]]
#> [1] "Barnehurst"
#> 
#> 
#> [[10]]$country
#> [[10]]$country[[1]]
#> [1] "England"
#> 
#> 
#> 
# }