
Complementando a resposta anterior (abaixo), o arquivo topodata do CMR não corresponde à área de interesse definida. A área coincidente é dada pelo arquivo 19S435SN.zip. ### require(raster) url=("http://www.dsr.inpe.br/topodata/data/geotiff/19S435SN.zip") download.file(url, destfile = "19S435SN.zip") dem <- raster('19S435SN.tif') ### Observe as saídas transcritas abaixo:
extent(SP.geo) class : Extent xmin : -42.40624 xmax : -42.37724 ymin : -19.51573 ymax : -19.48824 dem <- raster('19S435SN.tif') extent(dem) class : Extent xmin : -43.50024 xmax : -42 ymin : -20 ymax : -19
2013/7/24 Eder Comunello <ecomunel@gmail.com>
Prezado Alexandre,
Quanto ao erro de spTransform(), faltou dar espaço antes do argumento '+south'.
### INICIO
### bnds fornecido no CMS bnds <- structure(c(772259.1, 775259.1, 775259.1, 772259.1, 772259.1, 7843046, 7843046, 7840046, 7840046, 7843046), .Dim = c(5L, 2L ), .Dimnames = list(NULL, c("x", "y")))
### CRS UTM SP <- SpatialPolygons(list(Polygons(list(Polygon(bnds)), "1"))) proj4string(SP) = CRS("+proj=utm +zone=23 +south +datum=WGS84 +units=m +no_defs") ## Projeção
### CRS GEO SPgeo<- spTransform(SP, CRS("+proj=longlat +datum=WGS84")) ### aqui não é necessário +south SPgeo@bbox
### FIM
Com esse código você obterá:
SPgeo@bbox min max x -42.40624 -42.37724 y -19.51573 -19.48824
At.te,
-- Éder Comunello <comunello.eder@gmail.com> Dourados, MS - [22 16.5'S, 54 49'W]
-- Éder Comunello <c <comunello.eder@gmail.com>omunello.eder@gmail.com> Dourados, MS - [22 16.5'S, 54 49'W]