I am trying to plot a map using tmap
library:
library("rgdal")
library("tmap")
area_dnipro <- readOGR("dnipro.shp", encoding = "UTF-8", use_iconv=TRUE)
tm_shape(area_dnipro) + tm_polygons()
But during plotting I am getting this message:
Warning message:
In sp::proj4string(obj) : CRS object has comment, which is lost in output
Can anybody clearly explain the meaning of this message? Why does library (I guess sp
) outputs this for me? Something wrong with my shp-file? Can I do something in order not to get this warning? - May be transform my shape-file somehow? Because I am plotting this map from RStudio to HTML and don't want this text in the resulting HTML:
Here are my shape-files: download
P.S. I am aware about this topic but it doesn't shed light on this problem (at least for me). I don't understand what is the problem and what to do.
Use the sf
package to read the shapefile:
R> area_dnipro <- sf::read_sf("dnipro.shp")
R> tm_shape(area_dnipro) + tm_polygons()
this does not show the warning.
See also ?tm_shape
:
shp: shape object, which is an object from a class defined by the ‘sf’ or ‘stars’ package. Objects from the packages ‘sp’ and ‘raster’ are also supported, but discouraged.