[R-sig-Geo] bbox 4-dimensional objects - suitable method?

Torleif Markussen Lunde torleif.lunde at cih.uib.no
Mon Nov 23 14:21:14 CET 2009


Hi

As previously mentioned I am working on 3D and 4D spatial classes. To get 
things compatible with the other sp-classes I would like to ask for your 
opinion what would be the most suitable bbox methods for Spatial3dArrays and 
Spatial4dArrays.

My first thought was that bbox should return the 2D geographical extent of the 
object. This to comply with other spatial methods. For the 3D case an 
additional slot, btime is added to show the temporal extent of the object. As 
writing the 4D case, I started wondering whether it would be wise to stick to 
this (my conclusion at the moment is yes). In that case a new slot called 
zextent could be added.

To retrieve the extent of the different dimensions one would have three 
functions; bbox(), btime(), and zextent()

The other option is to make a bbox slot as a list. bbox() would still return 
x-y extent, while bbox.full() could return a list of the full extent:

list(bbox = matrix(c(1,1,4,4), 2,2, 
     			dimnames = list(c("long", "lat"), 
		     	c("min", "max"))),
    btime = matrix(c("2002-01-01 06:00:00", "2002-01-01 06:00:00"), 1, 2, 
     			dimnames = list(c("time"), 
		     	c("min", "max"))),
    zextent = matrix(c(512, 1024), 1,2, 
     			dimnames = list(c("masl"), 
		     	c("min", "max"))))

Since bbox is defined as a matrix in Spatial, this would be a bad idea. So, at 
best bbox could be a matrix of min/max of x, y, and z (since they all are 
numeric). bbox() would then return a x, y subset of bbox(), while bbox.full() 
could return a list(xyz, time). 

Any comments on what would be best suitable to be compatible with the other 
Spatial classes?

Best wishes
Torleif
PhD candidate
Centre for International Health
Bjerknes Centre for Climate Research
University of Bergen
Norway



More information about the R-sig-Geo mailing list