Skip to content

How to speed up the projection of a raster

2 messages · Manuel Spínola, Dominik Schneider

#
Dear list members,

I am trying to reproject a raster (see the code below), however the process
is too slow.  What I need to do to speed up the process? It took me seconds
to do the task in QGIS, but I prefer to do other raster projections in r.

Thank you very much in advance.
class       : RasterLayer
dimensions  : 16118, 21959, 353935162  (nrow, ncol, ncell)
resolution  : 98.4252, 98.4252  (x, y)
extent      : 183871.7, 2345191, 88600.88, 1675018  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5
+x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft
+no_defs
data source :
C:\Users\Manuel\Documents\Documentos_personales\Clases_y_Cursos\Clases\ICOMVIS\03_Evaluacion_del_Habitat\Practicos\Practica_03_Seleccion_de_habitat_Paisaje\oregon\lc.grd
names       : w001001
values      : 0, 95  (min, max)
attributes  :
       ID   COUNT       RED     GREEN      BLUE
 from:  0   60051 0.0000000 0.0000000 0.0000000
 to  : 95 2481857 0.4392157 0.6392157 0.7294118
                    LAND_COVER OPACITY
                  Unclassified       1
 Emergent Herbaceuous Wetlands       1
"ngb")
#
Manual,
I generally find gdal directly (which is what's used by qgis) to be faster
than the raster package.  I would use either:
1. gdalUtils package which essentially just provides r-style syntax to the
gdal commandline utilities
2. use system() with the gdal commandline utility command given as a string
to this function.
I use os x so not sure if things are the same on windows, if that's your OS.
gl
ds


On Fri, Feb 19, 2016 at 8:08 AM, Manuel Sp?nola <mspinola10 at gmail.com>
wrote: