Skip to content

Commit 19af834

Browse files
committed
fixes #158
1 parent b6e6839 commit 19af834

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

R/projectRaster.R

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ projectExtent <- function(object, crs) {
130130
fromcrs <- proj4string(fromcrs)
131131
pXY <- rgdal::rawTransform(fromcrs, crs, nrow(xy), xy[,1], xy[,2])
132132
}
133+
133134

134135
pXY <- cbind(pXY[[1]], pXY[[2]])
135-
out <- c((pXY[2,1] - pXY[1,1]), (pXY[4,2] - pXY[3,2]))
136+
# out <- c((pXY[2,1] - pXY[1,1]), (pXY[4,2] - pXY[3,2]))
137+
outex <- extent(pXY)
138+
out <- c(xmax(outex) - xmin(outex), ymax(outex) - ymin(outex))
139+
136140
if (any(is.na(out))) {
137141
if (isLonLat(obj)) {
138142
out <- pointDistance(cbind(x1, y1), cbind(x2, y2), lonlat=TRUE)

0 commit comments

Comments
 (0)