Dear Members,

               When I try to draw a shapefile lines (contorno_line 
object) inside a landsat imagem (landa object), my shapefile was 1330 
meters and 56° degree in a wrong position in the image. There are any 
solution for my problem? I try to use matrix rotation without success, 
script example:


require(raster)
require(sp)
require(maptools)
require(rgdal)

##------------------------------------------------------------------------------ 

## Bands 5, 4 e 3 do Landsat 5
#
#Download
links <- c(
"https://www.dropbox.com/s/6oie1ns3w52ur96/band5.crop.tif",
"https://www.dropbox.com/s/aa333he7g7vxcsj/band4.crop.tif",
"https://www.dropbox.com/s/3d7ad89uddx57o8/band3.crop.tif")

tokens    <- gsub("^.*/s/","",dirname(links))
fileNames <- basename(links)
newLinks  <- file.path("http://dl.dropbox.com/s", tokens, fileNames); 
newLinks

for (a in newLinks) {
           tryCatch(download.file(a, dest=basename(a), mode='wb'),
                               error=function(...) print("Falha no 
download!"))}

#Draw
r1a<-  raster(c("band5.crop.tif"))
r2a<-  raster(c("band4.crop.tif"))
r3a<-  raster(c("band3.crop.tif"))
landa<- stack(r1a,r2a,r3a)
plotRGB(landa)
#

#------------------------------------------------------------------------------- 

#shapefile download
links <- c(
"https://www.dropbox.com/s/1oz5lhnk96jih3w/Tamandua288.dbf",
"https://www.dropbox.com/s/6b3uygyrjhq1bby/Tamandua288.shp",
"https://www.dropbox.com/s/wntluhn8bi7us2f/Tamandua288.shx")

tokens    <- gsub("^.*/s/","",dirname(links))
fileNames <- basename(links)
newLinks  <- file.path("http://dl.dropbox.com/s", tokens, fileNames); 
newLinks

for (a in newLinks) {
           tryCatch(download.file(a, dest=basename(a), mode='wb'),
                               error=function(...) print("Falha no 
download!"))}

#open and draw
contorno_line <- readOGR(dsn="/Documents and 
Settings/ASANTOS/Desktop/Percevejo GIS", layer="Tamandua288")
CRS.new <- CRS("+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs 
+ellps=WGS84 +towgs84=0,0,0")
contorno_line.WGS84 <- spTransform(contorno_line, CRS.new)
projection(landa)
projection(contorno_line.WGS84)
lines(contorno_line.WGS84,col="red")
#

Thanks,

-- 
======================================================================
Alexandre dos Santos
Proteção Florestal
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)

         alexandre.santos@cas.ifmt.edu.br
Lattes: http://lattes.cnpq.br/1360403201088680
======================================================================


	[[alternative HTML version deleted]]

