So, if you plot the Canaries from a separate spatial feature with true coordinates, they won't coincide with the distorted map. ("Canary map far away from boundary map")Įsp_get_country() of library mapSpain returns a distorted map: the distance between the Canaries and the Spanish mainland has intentionally be shortended. #> Simple feature collection with 9642 features and 3 fields #> `C:\Users\XXXX\RtmpCOGdcp\pand_c.shp' using driver `ESRI Shapefile' Spain_coun_sf_nomoved Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1 sf_use_s2() is TRUEįile_path Reading layer `pand_c' from data source Since you use Canarias layer only I recommend you to use esp_get_ccaa("Canarias", moveCAN = FALSE) to focus only on that CCAA: library(mapSpain) with esp_getTiles() or addProviderEspTiles()) this option should be set to FALSE in order to get the actual coordinates, instead of the modified ones. When using the output for spatial analysis or using tiles (e.g. While moveCAN is useful for visualization, it would alter the actual geographic position of the Canary Islands. This is available in all the functions of the package, and all the doc packages have an specific section about this: You can avoid the displacement of the Canary Island using the option moveCAN = FALSE. Spain_coun_sf % addPolygons() %>% addPolygons(data = deser_sf_canarias) The code I am using is this: # get the boundary map from package 'mapSpain' I have tried the functions st_crs() to get the crs from the boundary map and the function st_transform() to reproject the sf object, but it didn't do anything. How can I project Canary Islands polygons from the sf as they are in the boundary map? The problem is that, in the sf object, Canary Islands are represented far away from the boundary map. I am using the function esp_get_country() from the library mapSpain, to get the boundaries of the country. I have a sf object with some drought data of Spain, and I want to project this data into a leaflet map.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |