Dear all,

this may just be plain stupid what I am asking -- please do tell me if it is.

I have worked on a tiff raster file of commercial shipping activity obtained from http://www.nceas.ucsb.edu/GlobalMarine/impacts 

This is a tiff file that is -- I think -- in sinusodial projection -- or at least some "ellipse" format; I could not find the information on how this tiff is created and maybe that is actually the source of my problems. In any case, I want to reproject the raster into some planar form to be then used with the gdistance package and some other rasters.


The code I use is the following:

tif<-"shapefiles/shipping_lzw.tif"
shl = raster(tif)

##typing in 
shl

class       : RasterLayer 
dimensions  : 19305, 38610, 745366050  (nrow, ncol, ncell)
resolution  : 934.4789, 934.4789  (x, y)
extent      : -18040095, 18040134, -9020047, 9020067  (xmin, xmax, ymin, ymax)
coord. ref. : NA
values      : shapefiles/shipping_lzw.tif 
layer name  : shipping_lzw 



#Now I think this is probably where I am making the mistake,
###not sure about this one, maybe this is where the error lies?
proj4string(shl)<-CRS("+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 
+units=m +no_defs")



###make it smaller as otherwise it will take ages to run
shl<-aggregate(shl, 10)

###this is what I want to project the raster to
proj <- CRS('+proj=longlat +ellps=WGS84')

###create an empty raster
r<-projectExtent(shl, proj)

s2 <- projectRaster(shl, r) 


I have plotted some graphs of how the raster looks before/ after.

This is how things look when I plot the raster as it is:

http://freigeist.devmag.net/wp-content/Screen-Shot-2013-07-16-at-07.21.15.png

And this is how it looks after I use the above code:

http://freigeist.devmag.net/wp-content/Screen-Shot-2013-07-16-at-07.21.41.png

Clearly there is something going wrong -- do you have any idea what? I guess it has to do with the wrong original projection , but how can I figure out what the original projection is / was?

Many thanks to your help and thoughts

best

----
Thiemo Fetzer
London School of Economics
STICERD
Houghton Street
WC2A 2AE London
United Kingdom

office: 32L, 3.01 D
tel: +44 7411 566845
skype: thiemo.fetzer
email: t.r.fetzer@lse.ac.uk
web: www.trfetzer.com


	[[alternative HTML version deleted]]

