Hallo,

I have used rgdal to generate a GeoTIFF for my krige Interpolation but the
output image is a 2 Band image und without RGB Color, my Question is haw to
give the RGB Color to my GeoTFF and how to increase resolution with rgdal.

And this is my R-File




 ## load some libraries first:

library(gstat)

library(RODBC)

library(rgdal)

library(grid)

library(intamap)

## load data

channel <- odbcConnect("postgis", "postgres", "postgres")

table = sqlQuery(channel, "SELECT max(stat.gid) as oid,max(stat.the_geom) as
the_geom,max(stat.station_latitude_d) as lat,max(stat.station_longitude_d)
as lon,max(stick.wert) as wert FROM luft_messstationen_meta as
stat,stickstoffdioxid as stick WHERE stat.gid=stick.station_id AND
date='2010-11-20' group by stat.gid order by oid;")

## gstat does not like missing data, subset original data:

e <- na.omit(table)


 coordinates(e) <- ~ lon+lat



 ## create a grid onto which we will interpolate:

## first get the range in data

x.range <- range(e@coords[,1])

y.range <- range(e@coords[,2])

## now expand to a grid with 500 meter spacing:

grd <- expand.grid(x=seq(from=x.range[1], to=x.range[2], by=0.05),
y=seq(from=y.range[1], to=y.range[2], by=0.05) )


 ## convert to SpatialPixel class

coordinates(grd) <- ~ x+y

gridded(grd) <- TRUE



 g <- krige(formula=wert ~1, e, grd,model=vgm(1,"Exp",300))



 proj4string(g) = CRS("+init=epsg:4326")

writeGDAL(g, "ordinary_kriging_1.tif", drivername="GTiff", type="Byte")



 Thanks

Tarek




-- 
Tarek Benamara

-- 
Tarek Benamara

	[[alternative HTML version deleted]]

