Skip to content

Commit e7b2d9f

Browse files
committed
m
1 parent d4c7143 commit e7b2d9f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/rast.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ setMethod("rast", signature(x="character"),
322322
} else if (isTRUE(guessCRS)) {
323323
if (crs(r) == "") {
324324
e <- ext(r)
325-
if ((e$xmin >= -180) && (e$xmax <= 360) && (e$ymin >= -90) && (e$ymax <= 90)) {
325+
if ((e$xmin >= -180.1) && (e$xmax <= 360.1) && (e$ymin >= -90.1) && (e$ymax <= 90.1)) {
326326
crs(r) <- "OGC:CRS84"
327327
}
328328
}

src/read_gdal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ bool SpatRaster::constructFromFile(std::string fname, std::vector<int> subds, st
10011001
std::string crs = getDsWKT(poDataset);
10021002

10031003
if (crs.empty()) {
1004-
if (guessCRS && hasExtent && s.extent.xmin >= -180 && s.extent.xmax <= 360 && s.extent.ymin >= -90 && s.extent.ymax <= 90) {
1004+
if (guessCRS && hasExtent && s.extent.xmin >= -180.1 && s.extent.xmax <= 360.1 && s.extent.ymin >= -90.1 && s.extent.ymax <= 90.1) {
10051005
crs = "OGC:CRS84";
10061006
s.parameters_changed = true;
10071007
} else {

0 commit comments

Comments
 (0)