ropensci / osmdata

R package for downloading OpenStreetMap data
https://docs.ropensci.org/osmdata
314 stars 45 forks source link

command "osmdata::available_tags(feature = 'addr:postcode')" gives not the expected output #322

Closed boiled-data closed 1 year ago

boiled-data commented 1 year ago

Hi,

I would like to extract postal code information. When I run the code below the result is 'character(0)', i.e. not the expected output.

Code: available_features() # gives a lot of information, including addr:postcode osmdata::available_tags(feature = 'addr:postcode')

Output: character(0)

Can you please solve the issue? Thanks. :)

mpadge commented 1 year ago

Thanks @boiled-data, this is defitely a bug. That particular function directly scrapes the OSM wiki, and the page in question has changed in structure since the function was written, so no longer works. A fix will appear here shortly.

mpadge commented 1 year ago

You should now see this:

library (osmdata)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright
packageVersion ("osmdata")
#> [1] '0.2.1.5'
available_tags(feature = 'aerialway')
#> # A tibble: 14 × 2
#>    Key       Value       
#>    <chr>     <chr>       
#>  1 aerialway cable_car   
#>  2 aerialway chair_lift  
#>  3 aerialway drag_lift   
#>  4 aerialway gondola     
#>  5 aerialway goods       
#>  6 aerialway j-bar       
#>  7 aerialway magic_carpet
#>  8 aerialway mixed_lift  
#>  9 aerialway platter     
#> 10 aerialway pylon       
#> 11 aerialway rope_tow    
#> 12 aerialway station     
#> 13 aerialway t-bar       
#> 14 aerialway zip_line
available_tags(feature = 'addr:postcode')
#> # A tibble: 1 × 2
#>   Key           Value       
#>   <chr>         <chr>       
#> 1 addr:postcode user defined

Created on 2023-04-05 with reprex v2.0.2

boiled-data commented 1 year ago

Thanks a lot!