1

I recently updated my GDAL version and had some issues with rgdal, see here. I thought I fixed it, but now I'm getting this strange warning message. When I load a raster into R with the proj4string +proj=omerc +lat_0=35 +lonc=-75 +alpha=40 +k=0.9996 +x_0=0 +y_0=0 +gamma=40 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs I get this warning:

Warning message:
In .newCRS(value) :
  +proj=omerc +lat_0=0 +lonc=0 +alpha=0 +k=0 +x_0=0 +y_0=0 +gamma=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs is not a valid PROJ.4 CRS string

For some reason the k value was changed to 0. No biggie, I can change it manually. What is frustrating is that when I try to use writeRaster I get the same error message and the CRS doesn't write to the output GeoTiff file. So when I load the GeoTiff into QGIS or R it doesn't know where to put it b/c it's no longer geo-referenced.

proj4string(input) = CRS('+proj=omerc +lat_0=35 +lonc=-75 +alpha=40 +k=0.9996 +x_0=0 +y_0=0 +gamma=40 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs')
writeRaster(input, '/home/usr/Desktop/output.tif', 'GTiff', overwrite = TRUE)
Warning message:
In .newCRS(value) :
  +proj=omerc +lat_0=0 +lonc=0 +alpha=0 +k=0 +x_0=0 +y_0=0 +gamma=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs is not a valid PROJ.4 CRS string

I also tried using gdalwarp on the command line, which runs without warning or error, but also doesn't add the CRS to the output GeoTiff file. Strange...

user13317
  • 451
  • 3
  • 13
  • Actually, it seems all the parameters in the proj string are set to 0, not just k. Did you check your GDAL installation? Maybe it's missing the data directory (the one with all the .csv files with the definitions for datums, etc). – Sergio Monteleone Apr 14 '18 at 13:06
  • @S.Monteleone I tried to follow the advice in this [post](https://gis.stackexchange.com/questions/157059/repairing-broken-gdal-and-proj-4-on-ubuntu), but it didn't work. After re-installing everything using instructions from [here](https://jannes-m.github.io/RQGIS/articles/install_guide.html), it still has issues. Even my distribution of QGIS fails to find the CRS of geo-referenced tiff files that work on Windows. – user13317 Apr 16 '18 at 13:29
  • I'm afraid it's indeed an installation issue, hence your question may be off-topic here on SO. You may try to get some feedback at [gis.stackexchange.com](https://gis.stackexchange.com), although it's very unlikely if the issue is specific to your system setup. – Sergio Monteleone Apr 16 '18 at 14:06

1 Answers1

0

Check the working directory You may have set working directory to where your rater files are. But rgdal may be installed somewhere else.