riatelab / maptiles

Download, compose and display map tiles with R
94 stars 12 forks source link

Consistency issue with leaflet providers #31

Closed mtennekes closed 7 months ago

mtennekes commented 7 months ago

I noticed a small inconsistency with the leaflet providers:

library(maptiles)
library(leaflet)
a = names(maptiles:::maptiles_providers)
b = names(leaflet::providers)

a
#>  [1] "OpenStreetMap"                   "OpenStreetMap.DE"               
#>  [3] "OpenStreetMap.France"            "OpenStreetMap.HOT"              
#>  [5] "OpenTopoMap"                     "Stadia.Stamen.Toner"            
#>  [7] "Stadia.Stamen.TonerBackground"   "Stadia.Stamen.TonerLines"       
#>  [9] "Stadia.Stamen.TonerLabels"       "Stadia.Stamen.TonerLite"        
#> [11] "Stadia.Stamen.Watercolor"        "Stadia.Stamen.Terrain"          
#> [13] "Stadia.Stamen.TerrainBackground" "Stadia.Stamen.TerrainLabels"    
#> [15] "Esri.WorldStreetMap"             "Esri.DeLorme"                   
#> [17] "Esri.WorldTopoMap"               "Esri.WorldImagery"              
#> [19] "Esri.WorldTerrain"               "Esri.WorldShadedRelief"         
#> [21] "Esri.OceanBasemap"               "Esri.NatGeoWorldMap"            
#> [23] "Esri.WorldGrayCanvas"            "CartoDB.Positron"               
#> [25] "CartoDB.PositronNoLabels"        "CartoDB.PositronOnlyLabels"     
#> [27] "CartoDB.DarkMatter"              "CartoDB.DarkMatterNoLabels"     
#> [29] "CartoDB.DarkMatterOnlyLabels"    "CartoDB.Voyager"                
#> [31] "CartoDB.VoyagerNoLabels"         "CartoDB.VoyagerOnlyLabels"      
#> [33] "Thunderforest.OpenCycleMap"      "Thunderforest.Transport"        
#> [35] "Thunderforest.TransportDark"     "Thunderforest.SpinalMap"        
#> [37] "Thunderforest.Landscape"         "Thunderforest.Outdoors"         
#> [39] "Thunderforest.Pioneer"           "Thunderforest.MobileAtlas"      
#> [41] "Thunderforest.Neighbourhood"
b
#>   [1] "OpenStreetMap"                         
#>   [2] "OpenStreetMap.Mapnik"                  
#>   [3] "OpenStreetMap.DE"                      
#>   [4] "OpenStreetMap.CH"                      
#>   [5] "OpenStreetMap.France"                  
#>   [6] "OpenStreetMap.HOT"                     
#>   [7] "OpenStreetMap.BZH"                     
#>   [8] "MapTilesAPI"                           
#>   [9] "MapTilesAPI.OSMEnglish"                
#>  [10] "MapTilesAPI.OSMFrancais"               
#>  [11] "MapTilesAPI.OSMEspagnol"               
#>  [12] "OpenSeaMap"                            
#>  [13] "OPNVKarte"                             
#>  [14] "OpenTopoMap"                           
#>  [15] "OpenRailwayMap"                        
#>  [16] "OpenFireMap"                           
#>  [17] "SafeCast"                              
#>  [18] "Stadia"                                
#>  [19] "Stadia.AlidadeSmooth"                  
#>  [20] "Stadia.AlidadeSmoothDark"              
#>  [21] "Stadia.OSMBright"                      
#>  [22] "Stadia.Outdoors"                       
#>  [23] "Stadia.StamenToner"                    
#>  [24] "Stadia.StamenTonerBackground"          
#>  [25] "Stadia.StamenTonerLines"               
#>  [26] "Stadia.StamenTonerLabels"              
#>  [27] "Stadia.StamenTonerLite"                
#>  [28] "Stadia.StamenWatercolor"               
#>  [29] "Stadia.StamenTerrain"                  
#>  [30] "Stadia.StamenTerrainBackground"        
#>  [31] "Stadia.StamenTerrainLabels"            
#>  [32] "Stadia.StamenTerrainLines"             
#>  [33] "Thunderforest"                         
#>  [34] "Thunderforest.OpenCycleMap"            
#>  [35] "Thunderforest.Transport"               
#>  [36] "Thunderforest.TransportDark"           
#>  [37] "Thunderforest.SpinalMap"               
#>  [38] "Thunderforest.Landscape"               
#>  [39] "Thunderforest.Outdoors"                
#>  [40] "Thunderforest.Pioneer"                 
#>  [41] "Thunderforest.MobileAtlas"             
#>  [42] "Thunderforest.Neighbourhood"           
#>  [43] "CyclOSM"                               
#>  [44] "Jawg"                                  
#>  [45] "Jawg.Streets"                          
#>  [46] "Jawg.Terrain"                          
#>  [47] "Jawg.Sunny"                            
#>  [48] "Jawg.Dark"                             
#>  [49] "Jawg.Light"                            
#>  [50] "Jawg.Matrix"                           
#>  [51] "MapBox"                                
#>  [52] "MapTiler"                              
#>  [53] "MapTiler.Streets"                      
#>  [54] "MapTiler.Basic"                        
#>  [55] "MapTiler.Bright"                       
#>  [56] "MapTiler.Pastel"                       
#>  [57] "MapTiler.Positron"                     
#>  [58] "MapTiler.Hybrid"                       
#>  [59] "MapTiler.Toner"                        
#>  [60] "MapTiler.Topo"                         
#>  [61] "MapTiler.Voyager"                      
#>  [62] "TomTom"                                
#>  [63] "TomTom.Basic"                          
#>  [64] "TomTom.Hybrid"                         
#>  [65] "TomTom.Labels"                         
#>  [66] "Esri"                                  
#>  [67] "Esri.WorldStreetMap"                   
#>  [68] "Esri.DeLorme"                          
#>  [69] "Esri.WorldTopoMap"                     
#>  [70] "Esri.WorldImagery"                     
#>  [71] "Esri.WorldTerrain"                     
#>  [72] "Esri.WorldShadedRelief"                
#>  [73] "Esri.WorldPhysical"                    
#>  [74] "Esri.OceanBasemap"                     
#>  [75] "Esri.NatGeoWorldMap"                   
#>  [76] "Esri.WorldGrayCanvas"                  
#>  [77] "OpenWeatherMap"                        
#>  [78] "OpenWeatherMap.Clouds"                 
#>  [79] "OpenWeatherMap.CloudsClassic"          
#>  [80] "OpenWeatherMap.Precipitation"          
#>  [81] "OpenWeatherMap.PrecipitationClassic"   
#>  [82] "OpenWeatherMap.Rain"                   
#>  [83] "OpenWeatherMap.RainClassic"            
#>  [84] "OpenWeatherMap.Pressure"               
#>  [85] "OpenWeatherMap.PressureContour"        
#>  [86] "OpenWeatherMap.Wind"                   
#>  [87] "OpenWeatherMap.Temperature"            
#>  [88] "OpenWeatherMap.Snow"                   
#>  [89] "HERE"                                  
#>  [90] "HERE.normalDay"                        
#>  [91] "HERE.normalDayCustom"                  
#>  [92] "HERE.normalDayGrey"                    
#>  [93] "HERE.normalDayMobile"                  
#>  [94] "HERE.normalDayGreyMobile"              
#>  [95] "HERE.normalDayTransit"                 
#>  [96] "HERE.normalDayTransitMobile"           
#>  [97] "HERE.normalDayTraffic"                 
#>  [98] "HERE.normalNight"                      
#>  [99] "HERE.normalNightMobile"                
#> [100] "HERE.normalNightGrey"                  
#> [101] "HERE.normalNightGreyMobile"            
#> [102] "HERE.normalNightTransit"               
#> [103] "HERE.normalNightTransitMobile"         
#> [104] "HERE.reducedDay"                       
#> [105] "HERE.reducedNight"                     
#> [106] "HERE.basicMap"                         
#> [107] "HERE.mapLabels"                        
#> [108] "HERE.trafficFlow"                      
#> [109] "HERE.carnavDayGrey"                    
#> [110] "HERE.hybridDay"                        
#> [111] "HERE.hybridDayMobile"                  
#> [112] "HERE.hybridDayTransit"                 
#> [113] "HERE.hybridDayGrey"                    
#> [114] "HERE.hybridDayTraffic"                 
#> [115] "HERE.pedestrianDay"                    
#> [116] "HERE.pedestrianNight"                  
#> [117] "HERE.satelliteDay"                     
#> [118] "HERE.terrainDay"                       
#> [119] "HERE.terrainDayMobile"                 
#> [120] "HEREv3"                                
#> [121] "HEREv3.normalDay"                      
#> [122] "HEREv3.normalDayCustom"                
#> [123] "HEREv3.normalDayGrey"                  
#> [124] "HEREv3.normalDayMobile"                
#> [125] "HEREv3.normalDayGreyMobile"            
#> [126] "HEREv3.normalDayTransit"               
#> [127] "HEREv3.normalDayTransitMobile"         
#> [128] "HEREv3.normalNight"                    
#> [129] "HEREv3.normalNightMobile"              
#> [130] "HEREv3.normalNightGrey"                
#> [131] "HEREv3.normalNightGreyMobile"          
#> [132] "HEREv3.normalNightTransit"             
#> [133] "HEREv3.normalNightTransitMobile"       
#> [134] "HEREv3.reducedDay"                     
#> [135] "HEREv3.reducedNight"                   
#> [136] "HEREv3.basicMap"                       
#> [137] "HEREv3.mapLabels"                      
#> [138] "HEREv3.trafficFlow"                    
#> [139] "HEREv3.carnavDayGrey"                  
#> [140] "HEREv3.hybridDay"                      
#> [141] "HEREv3.hybridDayMobile"                
#> [142] "HEREv3.hybridDayTransit"               
#> [143] "HEREv3.hybridDayGrey"                  
#> [144] "HEREv3.pedestrianDay"                  
#> [145] "HEREv3.pedestrianNight"                
#> [146] "HEREv3.satelliteDay"                   
#> [147] "HEREv3.terrainDay"                     
#> [148] "HEREv3.terrainDayMobile"               
#> [149] "FreeMapSK"                             
#> [150] "MtbMap"                                
#> [151] "CartoDB"                               
#> [152] "CartoDB.Positron"                      
#> [153] "CartoDB.PositronNoLabels"              
#> [154] "CartoDB.PositronOnlyLabels"            
#> [155] "CartoDB.DarkMatter"                    
#> [156] "CartoDB.DarkMatterNoLabels"            
#> [157] "CartoDB.DarkMatterOnlyLabels"          
#> [158] "CartoDB.Voyager"                       
#> [159] "CartoDB.VoyagerNoLabels"               
#> [160] "CartoDB.VoyagerOnlyLabels"             
#> [161] "CartoDB.VoyagerLabelsUnder"            
#> [162] "HikeBike"                              
#> [163] "HikeBike.HikeBike"                     
#> [164] "HikeBike.HillShading"                  
#> [165] "BasemapAT"                             
#> [166] "BasemapAT.basemap"                     
#> [167] "BasemapAT.grau"                        
#> [168] "BasemapAT.overlay"                     
#> [169] "BasemapAT.terrain"                     
#> [170] "BasemapAT.surface"                     
#> [171] "BasemapAT.highdpi"                     
#> [172] "BasemapAT.orthofoto"                   
#> [173] "nlmaps"                                
#> [174] "nlmaps.standaard"                      
#> [175] "nlmaps.pastel"                         
#> [176] "nlmaps.grijs"                          
#> [177] "nlmaps.water"                          
#> [178] "nlmaps.luchtfoto"                      
#> [179] "NASAGIBS"                              
#> [180] "NASAGIBS.ModisTerraTrueColorCR"        
#> [181] "NASAGIBS.ModisTerraBands367CR"         
#> [182] "NASAGIBS.ViirsEarthAtNight2012"        
#> [183] "NASAGIBS.ModisTerraLSTDay"             
#> [184] "NASAGIBS.ModisTerraSnowCover"          
#> [185] "NASAGIBS.ModisTerraAOD"                
#> [186] "NASAGIBS.ModisTerraChlorophyll"        
#> [187] "NLS"                                   
#> [188] "JusticeMap"                            
#> [189] "JusticeMap.income"                     
#> [190] "JusticeMap.americanIndian"             
#> [191] "JusticeMap.asian"                      
#> [192] "JusticeMap.black"                      
#> [193] "JusticeMap.hispanic"                   
#> [194] "JusticeMap.multi"                      
#> [195] "JusticeMap.nonWhite"                   
#> [196] "JusticeMap.white"                      
#> [197] "JusticeMap.plurality"                  
#> [198] "GeoportailFrance"                      
#> [199] "GeoportailFrance.plan"                 
#> [200] "GeoportailFrance.parcels"              
#> [201] "GeoportailFrance.orthos"               
#> [202] "OneMapSG"                              
#> [203] "OneMapSG.Default"                      
#> [204] "OneMapSG.Night"                        
#> [205] "OneMapSG.Original"                     
#> [206] "OneMapSG.Grey"                         
#> [207] "OneMapSG.LandLot"                      
#> [208] "USGS"                                  
#> [209] "USGS.USTopo"                           
#> [210] "USGS.USImagery"                        
#> [211] "USGS.USImageryTopo"                    
#> [212] "WaymarkedTrails"                       
#> [213] "WaymarkedTrails.hiking"                
#> [214] "WaymarkedTrails.cycling"               
#> [215] "WaymarkedTrails.mtb"                   
#> [216] "WaymarkedTrails.slopes"                
#> [217] "WaymarkedTrails.riding"                
#> [218] "WaymarkedTrails.skating"               
#> [219] "OpenAIP"                               
#> [220] "OpenSnowMap"                           
#> [221] "OpenSnowMap.pistes"                    
#> [222] "AzureMaps"                             
#> [223] "AzureMaps.MicrosoftImagery"            
#> [224] "AzureMaps.MicrosoftBaseDarkGrey"       
#> [225] "AzureMaps.MicrosoftBaseRoad"           
#> [226] "AzureMaps.MicrosoftBaseHybridRoad"     
#> [227] "AzureMaps.MicrosoftTerraMain"          
#> [228] "AzureMaps.MicrosoftWeatherInfraredMain"
#> [229] "AzureMaps.MicrosoftWeatherRadarMain"   
#> [230] "SwissFederalGeoportal"                 
#> [231] "SwissFederalGeoportal.NationalMapColor"
#> [232] "SwissFederalGeoportal.NationalMapGrey" 
#> [233] "SwissFederalGeoportal.SWISSIMAGE"
setdiff(a, b)
#> [1] "Stadia.Stamen.Toner"             "Stadia.Stamen.TonerBackground"  
#> [3] "Stadia.Stamen.TonerLines"        "Stadia.Stamen.TonerLabels"      
#> [5] "Stadia.Stamen.TonerLite"         "Stadia.Stamen.Watercolor"       
#> [7] "Stadia.Stamen.Terrain"           "Stadia.Stamen.TerrainBackground"
#> [9] "Stadia.Stamen.TerrainLabels"

Created on 2024-01-15 with reprex v2.0.2

The 'Stadia' names in maptiles have a second dot. Can you remove those?

If not, is the list of maptiles provided exported somewhere? No I have to make use of the ::: operator.

rCarto commented 7 months ago

Thanks. I did both. The next release will use leaflet providers names and will gain a get_providers() fun. You can expect a release on CRAN in a month or so.

mtennekes commented 7 months ago

Awesome, thx!