I am using ubuntu 18.04 and the following code is generating an error
library(sf)
library(tmap)
library(dplyr)
library(raster)
#sudo apt install libproj-dev
#devtools::install_github("robinlovelace/geocompr")
library(spDataLarge)
if(!file.exists("e.tif"))
download.file("https://github.com/geocompr/geocompkg/releases/download/0.1/e.tif",
"e.tif")
elev = raster("e.tif")
urban = spData::urban_agglomerations %>%
filter(year == 2030) %>%
dplyr::select(population_millions)
summary(urban)
tm_shape(elev) +
tm_raster(breaks = c(-10000, 0, 10, 50, 100, 10000)) +
tm_shape(urban) +
tm_dots(size = "population_millions", scale = 0.5)
I get the following error
Error in CPL_transform(x, crs, aoi, pipeline, reverse) :
OGRCreateCoordinateTransformation() returned NULL: PROJ available?
In addition: Warning message:
In CPL_transform(x, crs, aoi, pipeline, reverse) :
GDAL Error 1: No PROJ.4 translation for source SRS, coordinate transformation initialization has failed.
If I update PROJ using
sudo apt-get install proj-bin
It says I have the most recent version
proj-bin is already the newest version (5.2.0-1~bionic0).
Any help would be appreciated.