Skip to contents

Database of available categories that can be used for filtering results provided by arc_geo(), arc_geo_multi() and arc_geo_categories() in tibble format.

Format

A tibble with 376 rows and fields:

level_1

Top-level category

level_2

Second-level category

level_3

Child-level category

Details

See ArcGIS REST Category filtering for details and examples.

The geocoding service allows users to search for and geocode many types of addresses and places around the world. This simplifies the application building process, as developers don't need to know what types of places their users are searching for, because the service can decipher that. However, due to this flexibility, it is possible for ambiguous searches to match to many different places, and users may sometimes receive unexpected results. For example, a search for a city may match to a street name, or a search for an airport code may match to a country abbreviation.

For such cases, the service provides the ability to filter out unwanted geocode results with the category parameter. The category parameter limits the types of places for which the service searches, thus eliminating false positive matches and potentially speeding up the search process.

The results shows a list of categories with three different hierarchy levels (level_1, level_2, level_3). If a level_1 category is requested (i.e. POI) the child categories may be included also in the results.

Note

Data extracted on 10 January 2023.

Examples

# \donttest{
# Get all possible values
data("arc_categories")
arc_categories
#> # A tibble: 376 × 3
#>    level_1 level_2          level_3
#>    <chr>   <chr>            <chr>  
#>  1 Address Subaddress       NA     
#>  2 Address Point Address    NA     
#>  3 Address Street Address   NA     
#>  4 Address Distance Marker  NA     
#>  5 Address Intersection     NA     
#>  6 Address Street Midblock  NA     
#>  7 Address Street Name      NA     
#>  8 Postal  Primary Postal   NA     
#>  9 Postal  Postal Locality  NA     
#> 10 Postal  Postal Extension NA     
#> # ℹ 366 more rows

# Using categories

sea_1 <- arc_geo("sea",
  custom_query = list(outFields = c("LongLabel", "Type")),
  limit = 2
)


dplyr::glimpse(sea_1)
#> Rows: 2
#> Columns: 15
#> $ query      <chr> "sea", "sea"
#> $ lat        <dbl> 47.44362, 47.44899
#> $ lon        <dbl> -122.3029, -122.3093
#> $ address    <chr> "SEA", "SEA"
#> $ score      <int> 100, 100
#> $ x          <dbl> -122.3029, -122.3093
#> $ y          <dbl> 47.44362, 47.44899
#> $ LongLabel  <chr> "SEA, 17801 International Blvd, Seattle, WA, 98158, USA", "…
#> $ Type       <chr> "Airport", "Airport"
#> $ xmin       <dbl> -122.3079, -122.3393
#> $ ymin       <dbl> 47.43862, 47.41899
#> $ xmax       <dbl> -122.2979, -122.2793
#> $ ymax       <dbl> 47.44862, 47.47899
#> $ wkid       <int> 4326, 4326
#> $ latestWkid <int> 4326, 4326

# An airport, but if we use categories...

sea_2 <- arc_geo("sea",
  custom_query = list(outFields = c("LongLabel", "Type")),
  limit = 2, category = "Food"
)

dplyr::glimpse(sea_2)
#> Rows: 2
#> Columns: 15
#> $ query      <chr> "sea", "sea"
#> $ lat        <dbl> 40.71805, 54.98194
#> $ lon        <dbl> -73.959926, -1.705278
#> $ address    <chr> "Sea", "Sea"
#> $ score      <int> 100, 100
#> $ x          <dbl> -73.959926, -1.705278
#> $ y          <dbl> 40.71805, 54.98194
#> $ LongLabel  <chr> "Sea, 114 N 6th St, Brooklyn, NY, 11249, USA", "Sea, Close,…
#> $ Type       <chr> "Restaurant", "Brewpub"
#> $ xmin       <dbl> -73.960926, -1.710278
#> $ ymin       <dbl> 40.71705, 54.97694
#> $ xmax       <dbl> -73.958926, -1.700278
#> $ ymax       <dbl> 40.71905, 54.98694
#> $ wkid       <int> 4326, 4326
#> $ latestWkid <int> 4326, 4326

# We can use a list of categories
sea_3 <- arc_geo("sea",
  custom_query = list(outFields = c("LongLabel", "Type")),
  sourcecountry = "UK", limit = 5,
  category = c("Amusement Park", "Aquarium")
)

dplyr::glimpse(sea_3)
#> Rows: 5
#> Columns: 15
#> $ query      <chr> "sea", "sea", "sea", "sea", "sea"
#> $ lat        <dbl> 50.62565, 53.81286, 52.60033, 50.81960, 51.53165
#> $ lon        <dbl> -2.4444962, -3.0549012, 1.7364876, -0.1358032, 0.7258312
#> $ address    <chr> "Sea Life & Marine Park", "Sea Life Centre", "Sea Life Cent…
#> $ score      <dbl> 83.89, 83.00, 83.00, 82.00, 81.88
#> $ x          <dbl> -2.4444962, -3.0549012, 1.7364876, -0.1358032, 0.7258312
#> $ y          <dbl> 50.62565, 53.81286, 52.60033, 50.81960, 51.53165
#> $ LongLabel  <chr> "Sea Life & Marine Park, Greenhill, Weymouth, Dorset, Engla…
#> $ Type       <chr> "Aquarium", "Aquarium", "Aquarium", "Aquarium", "Aquarium"
#> $ xmin       <dbl> -2.4494962, -3.0599012, 1.7314876, -0.1408032, 0.7208312
#> $ ymin       <dbl> 50.62065, 53.80786, 52.59533, 50.81460, 51.52665
#> $ xmax       <dbl> -2.4394962, -3.0499012, 1.7414876, -0.1308032, 0.7308312
#> $ ymax       <dbl> 50.63065, 53.81786, 52.60533, 50.82460, 51.53665
#> $ wkid       <int> 4326, 4326, 4326, 4326, 4326
#> $ latestWkid <int> 4326, 4326, 4326, 4326, 4326
# }